If you're talking server side... <cfif isNumeric(form.field) and len(form.field) is 2> do stuff </cfif>
Client side, you'd need to either use cfform or roll your own js function. But, is the length always going to be 2? What if the hours entered is less than 10? You may not want to require them to enter 03 or whatever. You can limit that entry by doing something like <cfif isNumeric(form.field) and len(form.field) LTE 2> Depending on how you want to limit the number of hours entered. -- Josh ----- Original Message ----- From: "Rick Dennis" <[EMAIL PROTECTED]> To: "CF-Talk" <[email protected]> Sent: Monday, October 23, 2006 11:23 AM Subject: Validate is form field numeric and length of filed >I have a form input called "hours". > > how would i write a <CFIF> > > that would check the length of 2 and make sure it was numeric only? no > spaces or special characters? > > thanks. > > > Rick Dennis > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:257780 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

