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:
Looking for easy way to back up dbs... (2003)
authenticate broken when url not fully specified? (2000)
limitation found on group searching (1997)
Lost and Recovered. (1998)
[WebDNA] sudo and shell (2010)
WebCat2: Items xx to xx shown, etc. (1997)
docs for WebCatalog2 (1997)
WebCatalog NT (1996)
[WebDNA] webDNA and JSON (2011)
OT (But could use some help) Meta refresh not working. (2001)
StoreBuilder and PayPal (2002)
Moment of Thanks (1997)
PCS Emailer's role ? (1997)
Couple of questions (1999)
WebCat website for developers and hosters (2001)
[Sum] function? (1997)
WebCat b15 Mac plug-in (1997)
WebCat2: Master Counter snippet (1997)
RE: NewCart+Search with one click ? (1997)
sort problems....bug or brain fart? (1997)