Text field

liunx

Guest
Hi<br />
<br />
Does anybody know how to set permit size of tex box in form??. I meen that the end user will be only allow to enter presise number of signes in text box.<br />
<br />
Do you kno codes for that??<br />
THanks<!--content-->I'm not sure if you mean the textarea or an input tag. For an input tag you can use:<br />
<br />
<input type=text maxlength=30><br />
<br />
That will allow only 30 characters inputted into the text field but unless the script is also checking the quantity of characters it is easy to change that by saving the form to the hard drive and editing the maxlength attribute. <br />
<br />
To limit the amount of data in a textarea is different and I would need to look how to do it for sure but suspect it can only be done reliably on the server side. Maybe someone else will know.<br />
<br />
Regards,<br />
Kevin<!--content-->Either use the attributes of the text tag like so:<br />
<input type=text size=30 maxlength=30><br />
This will set the physical size of the textbox to 30 with the size attribute, and the maxlength attribute will not allow any more than the set amount of characters.<br />
<br />
If you are using the <textarea> tag, there may be a way to do so using Javascript or VBscript or some other client side scripting.<br />
<br />
Hope this helps!<br />
Ken<!--content-->
 
Back
Top