|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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?
|
|
#2
|
||||
|
||||
|
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 |
|
#3
|
|||
|
|||
|
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 |
|
#4
|
|||
|
|||
|
yes. and you can validate it on the client-side. use cfinput and a regular expression.
check out: URL |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > ColdFusion Development > Form Validation |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|