Hi,
I have a textarea with 292px width.
1) How can I force a break-line when the text is over 292px?
2) How can I announce the user that the text is over 9 lines? (I want a limit of 9 lines)
Thanks!
Hi,
I have a textarea with 292px width.
1) How can I force a break-line when the text is over 292px?
2) How can I announce the user that the text is over 9 lines? (I want a limit of 9 lines)
Thanks!
Got this from older post:
Code:var maximumLength = 292; function checkLength(control, maximum) { var length = control.value.length; if (length > maximum) { alert('Please limit your message to ' + maximumLength + ' characters. There are currently ' + length + '.'); return false; } return true; } function validate(form) { var controls = form.elements; if (!checkLength(controls.textArea, maximumLength)) return false; return true; }gud luckCode:<form action="..." onsubmit="return validate(this);"> <!-- ... --> <textarea ... onchange="checkLength(this, maximumLength);"></textarea> <!-- ... --> </form>
lord22 (11-09-2009)
Well i don't know how to count the 9 lines but you can wrap the text using the html tag wrap="soft" (without sending out the carriage returns) or wrap="hard" (sending out the carriage returns). I always use the soft one...
Hope this can help a bit...
lord22 (11-09-2009)
Bookmarks