Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limit number of words in input

Status
Not open for further replies.

trojan800

Programmer
Nov 27, 2001
53
US
I have a form that lets a user update some fields in my database. My problem is I need to limit their entry in one of the fields to NO more than 100 words. How would I go about checking for this? Is there some function to find the 100th space in a string or something of the sort? Any ideas are greatly appreciated. I realize that this might be more of a javascript question as well but you asp guys seem to be on point with that as well. TIA - Rory
 
you using HTML form? if so, then try:

<INPUT TYPE=&quot;TEXT&quot; SIZE=&quot;30&quot; MAXLENGTH=&quot;8&quot;>
 
Thanks you so much mr3putt! That looks like exactly what I am looking for. Again, thanks!
 
why not just slit on the space and test the ubound returned value of the array for > then 100?

If Ubound(split(Request.Form(&quot;paragraph&quot;),&quot; &quot;)) > 100 Then



____________________________________________________
The most important part of your thread is the subject line.
Make it clear and about the topic so we can find it later for reference. Please!! faq333-2924

onpnt2.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top