Expand|Select|Wrap|Line Numbers
- function textCounter(field, countfield, maxlimit) {
- if (field.value.length > maxlimit){
- field.value = field.value.substring(0, maxlimit);
- }
- else {
- countfield = Number(maxlimit) - Number(field.value.length);
- }
- }
I am using textarea that has limit of 50 characters. After i enter 50 characters,i put cursor in the middle of the text to edit the text entered.
The problem is When i enter one character, it takes that character and go at the end to delete the last character, it deletes it but stays there and doesnot come back to editing position.I want the cursor to remain at that position only and deletion to take place automatically from the end.
Please help with an answer asap. Thanks in advance.:)