HTML & PHP Mailto form

Soldato
Joined
1 Dec 2004
Posts
23,079
Location
S.Wales
Quick question, is there anyway of enforcing a limit on the number of charactors in a html form, php is being used with the form aswel to execute the mailto part of it.

Also another thing, in IE when filling in the message field, when you get to the end of a line it will automatically go down to the next line as, but in firefox it will continue to scroll to the right making it horizontally scrollable, instead of vertical scrolling.
 
I assume this is a textarea?
The behaviour you describe of it continuing on one line only happens when it is all one long word, i.e. hold down one key and it will fill the box in IE but go off horizontally in firefox. The firefox behaviour is arguably more logical than IEs but I doubt you can change it in either browser.
As soon as there is a space in the text (i.e. multiple words) it will wrap onto the next line.

I think you would need to use javascript to enforce a limit on the length of a textarea because it doesn't seem to have a maxmimum length property.
Something along the lines of: http://javascript.internet.com/forms/limit-textarea.html

You would still have to use PHP to check it though because Javascript might be disabled so I would assume you want to use strlen().
 
|Ric| said:
I assume this is a textarea?
The behaviour you describe of it continuing on one line only happens when it is all one long word, i.e. hold down one key and it will fill the box in IE but go off horizontally in firefox. The firefox behaviour is arguably more logical than IEs but I doubt you can change it in either browser.
As soon as there is a space in the text (i.e. multiple words) it will wrap onto the next line.

I think you would need to use javascript to enforce a limit on the length of a textarea because it doesn't seem to have a maxmimum length property.
Something along the lines of: http://javascript.internet.com/forms/limit-textarea.html

You would still have to use PHP to check it though because Javascript might be disabled so I would assume you want to use strlen().

Ahh yes i see what you mean! just tested it and it wrapped down to the next line. I will have a look at the javascript part later to enforce some sort of limit on the fields.

Thank you :)
 
Back
Top Bottom