HTML Character limiting code for html text area boxes.?
I am working on a html contact form that consists of a html page for the form and a php page to process the form.
The contact form works.
I have not designed the page so it is just a white page with the contact for on it.
I have put a html counter on the one box of the form which counts the number of characters in the box and i would now like to limit the number of characters that can be entered in to the box. I know this is possible.
I would like it so that there is a pop up box that comes up when the max number of characters is reached and then not let any more characters be entered but i do not need the pop up that is just an extra i just need a limit.
How can i do this?
This is the code for the box and the counter that i have so far (this is not the whole contact page it is just the box that i need the limit on and the counter that is with it:
<label for="comments">Message *</label>
<!-- Created by Barrett at RRPowered.com -->
<!-- File name contcar.html -->
$(".counter").text("Characters used: 0/100");
$(".counter").text("Characters used: "+counter+"/1000");
Thanks for your help...
I have but in the max length tag that you said for the text area as so:
it still allows more than 10 characters to it.
the text area is called text_field as stated in the coding...
What do i do?
were in the long script above do i put the max length?
- 9 years ago
EASY!! (if i know exactly what your saying)
if it is a textarea (i think it is)
<textarea maxlength="type the number of characters limit"></textarea>
if it is a input text tag, then:
<input type="text" or "password" maxlength="type the number of characters limit">
Hope this helped!
- Anonymous9 years ago