SunQuest
           ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old November 13th, 2003, 02:54 PM
katlees katlees is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 7 katlees User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Form Validation

Is there a way to validate a field so it has to have 4 numbers entered into it. No less and no more?

Reply With Quote
  #2  
Old November 14th, 2003, 09:30 AM
don_sparko's Avatar
don_sparko don_sparko is offline
Digitally Challenged
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2003
Posts: 280 don_sparko User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 54 m 14 sec
Reputation Power: 6
try using the coldfusion functions Len(variable) isNumeric(variable) Find(variable, stringtofind)
make sure the length is 4, its numeric, and it doesn't contain a . or -
__________________
My brain cells are like a storm trooper's armor: useless

Reply With Quote
  #3  
Old November 25th, 2003, 07:48 AM
cfcentral cfcentral is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 5 cfcentral User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Could try something like
Code:
<cfif LEN(TRIM(REReplaceNoCase(Form.FieldName,"[^[:digit:]]","","ALL")))>
Value is good
<cfelse>
Value is bad
</cfif>


If "[^[:digit:]]" doesnt work on your version of CF, you can use "[^[0-9]]".

I think "[^[0-9]]" is right

Steve

Reply With Quote
  #4  
Old November 27th, 2003, 10:53 AM
highwaysjammed4 highwaysjammed4 is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 4 highwaysjammed4 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
yes. and you can validate it on the client-side. use cfinput and a regular expression.

check out: URL

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > Form Validation


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway