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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

isValid(..) quick question 1

Status
Not open for further replies.

ice78991

Programmer
Nov 20, 2006
216
IsValid("string",arguments.str) will pass empty strings as valid. Is it possible to modify this so empty strings are not allowed
 
You can also do this, if what cfSearching says is true:

<cfset one = trim(FORM.string)>

THEN do:
isvalid("one",arguments.str)

_____________________________
Just Imagine.
 
Hi Kevin, isvalid("trim(string)",arguments.str) was my suggestion. I did not know that the first argument must be a valid type: "string".

My second example, was again a suggestion...I thought this should work. You'd be trimming FORM.string, then running it through isvalid(). In the second suggestion, the first argument must be a valid type: "string".

_____________________________
Just Imagine.
 
the first argument must Literally! be one of:

'string'
'integer'
'url'
'email'
(there are plenty more..)

the second is the variable that you are checking.

<cfset badEmail = "kevin#domain.com">
<cfset goodEmail = "kevin@domain.com">

isValid("email",badEmail) = FALSE
isValid("email",goodEmail) = TRUE



Kevin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top