Skip to main content
Known Participant
February 2, 2011
Question

need this small help

  • February 2, 2011
  • 2 replies
  • 619 views

Hi

I had a form with many form fileds and now we are adding one input text field that should be numeric with 5 digits long and i need to validate this input for numeric and 5 digits long(if the user enters anything in this field or its ok with empty field also if not entered) field with jquery with out submitting form any help in this.

<input type="text" name="myID" >

Thanks.

This topic has been closed for replies.

2 replies

Fernis
Inspiring
February 11, 2011

ColdFusion has these features built-in, so why not use those.

<cfform name="myform">

<cfinput type="text" name="zip" validate="regular_expression" pattern="^\d{5}" validateat="onBlur">

<cfinput type="submit" value="submit" name="submit">

</cfform>

If you don't want to define a custom regular expression as the validation pattern, check out the other options for the validate attribute.

http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7f51.html

-Fernis

existdissolve
Inspiring
February 2, 2011

Something like this might help: http://www.webreference.com/programming/javascript/jquery/form_validation/

Also, googling "jQuery form validation" (and other related phrases) will bring up a lot of good resources- that's how I found the one above.