Forums

Text box max lenght

Martinmk 05 Sep, 2011
Hello,
How do I restrict the maximum lenght of a text box. There is an option to do this in a text field, but I don't see any option to do this for a text box. Is there any way of doing this? It seems to be a simple task. Should I be using JS to do this?
thank you.
Martin
Martinmk 06 Sep, 2011
This is stunning. Thank you. The only problem I have is that every time I change something in the JS code it resets the code in the general form tab.
Also, is there a way to ad this JS to multiple text boxes? I tried setting 'counter' to a diferent name such as 'counter1', but it doesn't work.
M
GreyHead 16 Sep, 2011
Hi Martinmk,

every time I change something in the JS code it resets the code in the general form tab.

Sorry, I don't understand this - can you sa a bit more about how you are setting it up?

You should be able to duplicate the code for more than one textarea but you'd need to make sure that all the ids are unique and matched up to the coresponding JavaScript snippet.

Bob
This topic is locked and no more replies can be posted.