I have a textarea control to get some formula from user.eg : 200+4000+60000+7000000. I want to split the formula to new line if it won't accommodate in first line. It will move to new line, but numbers will break. Basic thing is numbers won't break.eg : 123456 won't break like 1234 in first line and 46 in next. How can I achieve this when user types on textarea?
Asked
Active
Viewed 64 times
0
-
do you have any code attempt to share? – MWO Dec 29 '21 at 05:51
-
You might be searching for input mask? you can create one for your own needs. – Forbidden Dec 29 '21 at 06:11
-
@Forbidden My requirement is like, when user type in and at end of a line it won't break numbers to next line – Anish Dec 29 '21 at 11:23
-
@MWO I tried some thing on typing to break the line. But it failed. – Anish Dec 29 '21 at 11:25
-
here is a [demo](https://codepen.io/harshkaso/pen/wvryaLR?editors=1011) i created by modifying this [answer](https://stackoverflow.com/a/19743610/16496244). I would say this question is a duplicate as it required minimal to no changes to achieve what you wanted, but still have a look and see if it works as intended. – K450 Dec 29 '21 at 13:41