![]() |
| ||
| limit no of char per line hi i have a text area where i want to limit the number of charactersin each line. for example if the user enters more than 50 caharacters it should automatically move the cursor to the next line thanks |
| ||
| Re: limit no of char per line I do not know if there is a simple way. But at this moment here what you can do. Write a event handler for onkeyup for your text area and count for every keypress if count exceeds 50 then append '\n'(new line character) by yourself. thats it. Your js keyhandler will look somthing like this:- var count = 0; |
| ||
| Re: limit no of char per line this is not working |
| ||
| Re: limit no of char per line What have you done till now? |
| ||
| Re: limit no of char per line Of course its working man. I tried it with document.getElementById('id of textarea') What you want? That a working code is delivered to you so that you can sit back and rest. |
| ||
| Re: limit no of char per line tried something like this <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| ||
| Re: limit no of char per line in the function you have passed a variable called 'e'...wat is tat for |
| ||
| Re: limit no of char per line Where you had set the id for textarea? ignore e in the function |
| ||
| Re: limit no of char per line i want it to work when the tries to paste also |
| All times are GMT -4. The time now is 4:31 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC