File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to restrict length of Text in a JSP

 
Neha Sharma
Ranch Hand
Posts: 126
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,
Though it is a HTML question, but I placed this one here as there was nothing indipendent for HTML.
How can I restrict number of Characters user can type in the text boxes. As when I use size= "25" though the box becomes 25 char long but you can write as many chacters in that.

<input type="text" size="25" name=<%=CORP_NAME%> value = "<%=getCmpnyName() %>" ></h6>
Neha
 
Terence Doyle
Ranch Hand
Posts: 328
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Neha,
Use 'maxlength=x' like this:
<input type="text" name="textfield" size="25" maxlength="20">
Bye,

------------------
Terry Doyle
Sun Certified Programmer for Java 2 Platform
 
Abraham Jacob
Greenhorn
Posts: 25
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI Neha,
Try this
<INPUT type="text" name="foo" maxlength="8" size="8">

maxlength determines the size
 
Neha Sharma
Ranch Hand
Posts: 126
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Guys !!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic