Re: Validation
This WebDNA talk-list message is from 2000
It keeps the original formatting.
numero = 29422
interpreted = N
texte = At 4:57 PM -0600 2000/03/21, Tony Frenzel wrote:>Is there any special way to validate and set parameters for a specific>field in a form in web catalog? For example if I want to make an e-mail>address field MANDATORY to fill out before continuing on... any suggestions?I was very surprised to discover that WebCat did not have built in tags for this. Since it was not built in, I have been collecting validation routines from hints and clues from various posts into one global include file. To use it, put an include such as: [include file=^-Validate &Nonblank=_First,_Last,_Initiated &DateCheck=_Birthdate &ZipCheck=_HZip,_EZip &EmailCheck=_HEmail,_EEmail](returns added for clarity - remove to use)The code of the include file is as follows (note I have not tested the numericCheck yet): -Chuck-[math show=f]error=0[/math][text]ErrMsg=[/text][!][CLOSEDATABASE ^-PictureCheckTable.db][/!][formvariables name=_&exact=F] [!] [name] - [index] - [value]
[/!] [!] ----------------------------------------------- NonBlank -- [/!] [showif [NonBlank]^[name]] [showif [url][value][/url]=] [math show=F]error=error+1[/math] [text]ErrMsg=[ErrMsg][name] cannot be left blank
[/text] [/showif] [/showif] [!] ----------------------------------------------- DateCheck -- [/!] [showif [DateCheck]^[name]] [hideif [url][value][/url]=] [showif NNNNsNNsNN![ConvertChars db=^-PictureCheckTable.db][value][/ConvertChars]] [math show=F]error=error+1[/math] [text]ErrMsg=[ErrMsg][name] [value] must be in YYYY/MM/DD format
[/text] [/showif] [/hideif] [/showif] [!] ----------------------------------------------- ZipCheck -- [/!] [showif [ZipCheck]^[name]] [hideif [url][value][/url]=] [text]tErr=T[/text] [showif NNNNN=[ConvertChars db=^-PictureCheckTable.db][value][/ConvertChars]] [text]tErr=F[/text] [/showif] [showif NNNNNdNNNN=[ConvertChars db=^-PictureCheckTable.db][value][/ConvertChars]] [text]tErr=F[/text] [/showif] [showif NNNdNNNN=[ConvertChars db=^-PictureCheckTable.db][value][/ConvertChars]] [text]tErr=F[/text] [/showif] [showif [tErr]=T] [math show=F]error=error+1[/math] [text]ErrMsg=[ErrMsg][name] [value] must be in nnnnn, nnnnn-nnnn, or nnn-nnnn format
[/text] [/showif] [/hideif] [/showif] [!] ----------------------------------------------- NumericCheck -- [/!] [showif [NumericCheck]^[name]] [hideif [url][value][/url]=] [showif [math show=T][admingiven]*0[/math]!0] [math show=F]error=error+1[/math] [text]ErrMsg=[ErrMsg][name] Value must contain only numbers
[/text] [/showif] [/hideif] [/showif] [!] ----------------------------------------------- EmailCheck -- [/!] [showif [EmailCheck]^[name]] [hideif [url][value][/url]=] [hideif [value]^@] [hideif [value]^.] [math show=F]error=error+1[/math] [text]ErrMsg=[ErrMsg][name] Email IDs must be in user@domain.com format
[/text] [/hideif] [/hideif] [/hideif] [/showif] [/formvariables] [!] ----------------------------------------------- Redirect -- [/!][showif [math]error[/math]>0] [redirect [listwords Words=[referrer]&delimiters=?][!] [/!][showif [index]=1][word][/showif][!] [/!][/listwords]?error=[math]error[/math][!] [/!]&ErrMsg=[URL][ErrMsg][/URL][!] [/!][formvariables][hideif [name]=template]&[name]=[url][value][/url][/hideif][/formvariables]][/showif][!]End ValidationChecker routine[/!]__________________________________________________________________________Chuck Rice
-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to
Associated Messages, from the most recent to the oldest:
At 4:57 PM -0600 2000/03/21, Tony Frenzel wrote:>Is there any special way to validate and set parameters for a specific>field in a form in web catalog? For example if I want to make an e-mail>address field MANDATORY to fill out before continuing on... any suggestions?I was very surprised to discover that WebCat did not have built in tags for this. Since it was not built in, I have been collecting validation routines from hints and clues from various posts into one global include file. To use it, put an include such as: [include file=^-Validate &Nonblank=_First,_Last,_Initiated &DateCheck=_Birthdate &ZipCheck=_HZip,_EZip &EmailCheck=_HEmail,_EEmail](returns added for clarity - remove to use)The code of the include file is as follows (note I have not tested the numericCheck yet): -Chuck-[math show=f]error=0[/math][text]ErrMsg=[/text][!][CLOSEDATABASE ^-PictureCheckTable.db][/!][formvariables name=_&exact=F] [!] [name] - [index] - [value]
[/!] [!] ----------------------------------------------- NonBlank -- [/!] [showif [NonBlank]^[name]] [showif [url][value][/url]=] [math show=F]error=error+1[/math] [text]ErrMsg=[ErrMsg][name] cannot be left blank
[/text] [/showif] [/showif] [!] ----------------------------------------------- DateCheck -- [/!] [showif [DateCheck]^[name]] [hideif [url][value][/url]=] [showif NNNNsNNsNN![ConvertChars db=^-PictureCheckTable.db][value][/ConvertChars]] [math show=F]error=error+1[/math] [text]ErrMsg=[ErrMsg][name] [value] must be in YYYY/MM/DD format
[/text] [/showif] [/hideif] [/showif] [!] ----------------------------------------------- ZipCheck -- [/!] [showif [ZipCheck]^[name]] [hideif [url][value][/url]=] [text]tErr=T[/text] [showif NNNNN=[ConvertChars db=^-PictureCheckTable.db][value][/ConvertChars]] [text]tErr=F[/text] [/showif] [showif NNNNNdNNNN=[ConvertChars db=^-PictureCheckTable.db][value][/ConvertChars]] [text]tErr=F[/text] [/showif] [showif NNNdNNNN=[ConvertChars db=^-PictureCheckTable.db][value][/ConvertChars]] [text]tErr=F[/text] [/showif] [showif [tErr]=T] [math show=F]error=error+1[/math] [text]ErrMsg=[ErrMsg][name] [value] must be in nnnnn, nnnnn-nnnn, or nnn-nnnn format
[/text] [/showif] [/hideif] [/showif] [!] ----------------------------------------------- NumericCheck -- [/!] [showif [NumericCheck]^[name]] [hideif [url][value][/url]=] [showif [math show=T][admingiven]*0[/math]!0] [math show=F]error=error+1[/math] [text]ErrMsg=[ErrMsg][name] Value must contain only numbers
[/text] [/showif] [/hideif] [/showif] [!] ----------------------------------------------- EmailCheck -- [/!] [showif [EmailCheck]^[name]] [hideif [url][value][/url]=] [hideif [value]^@] [hideif [value]^.] [math show=F]error=error+1[/math] [text]ErrMsg=[ErrMsg][name] Email IDs must be in user@domain.com format
[/text] [/hideif] [/hideif] [/hideif] [/showif] [/formvariables] [!] ----------------------------------------------- Redirect -- [/!][showif [math]error[/math]>0] [redirect [listwords Words=[referrer]&delimiters=?][!] [/!][showif [index]=1][word][/showif][!] [/!][/listwords]?error=[math]error[/math][!] [/!]&ErrMsg=[url][ErrMsg][/URL][!] [/!][formvariables][hideif [name]=template]&[name]=[url][value][/url][/hideif][/formvariables]][/showif][!]End ValidationChecker routine[/!]__________________________________________________________________________Chuck Rice -------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to
Chuck Rice
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
[WebDNA] [BULK] The WebDAV Server Module / web services (2012)
No Line Breaks from OSX server (2002)
Harvesting invalid email addresses from bounced emails??? (2000)
WC Database Format (1997)
Blowback and budgets. (2000)
Capitalize (2003)
Tax & Shipping (1997)
[WebDNA] WebDNA restart script (2015)
(1998)
Christmas countdown (1998)
notification solutions (1997)
Migrating to NT (1997)
WebCat2final1 crashes (1997)
Limit on nested [ShowIf]'s? (1997)
Paramater Passing Value (2002)
Triggers (1999)
Hide Cart ID in URL? (2003)
cart (1997)
[UPPERCASE] (1997)
Who's Security? (2000)