View Full Version : line check ?

10-23-2005, 07:35 AM
To replace a standard textarea, I make use of a so called WYSIWYG. I use the coding at: http://www.dynamicdrive.com/dynamici...itor/index.htm for this. Though now I want to include something extra's namely a check on how many lines are inputted by the user.

I don't want the user to submit more then lets say 40 lines. If he/she inputs more then 40 lines the form may not be submitted, and an alert box should appear. I also want this to happen if he/she submits no lines.

10-23-2005, 11:42 AM
never mind, i will look for an other solution..

10-24-2005, 05:20 AM
You can't really count the lines because every text box is a different size and shape, but you could do it by counting characters or words and setting a max. number of words or characters to allow, and you could always figure out the lines by creating the text box the size that you want and then counting how many characters are in one line and multiplying that by the number of lines you want to allow. sound decent?

10-24-2005, 07:30 AM
for a textbox the 'cols' value is how many characters you can type in one row, so if you have a textbox that has 'cols="30"' and you only want to allow 40 lines then you can only allow 1200 characters. (num. of cols x 40 lines).