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:
RE: Price recalc based on quantity (1997)
HomePage Caution (1997)
Memory Error message (1998)
How do you hide [math]stuff[/math] (1997)
can WC render sites out? (1997)
page chokes on hideif when false and ignored (1998)
carriage returns in data (1997)
[WebDNA] bug in sending & character to DOS (2010)
WebCat2b13MacPlugIn - [include] doesn't allow creator (1997)
Encrypted links ... (2000)
Webcatalog error, Plug-in for Webstar (1996)
Updating a database once per day - An example (1998)
Stumpted Again (1997)
weird happenings (1997)
textarea question (1998)
Setting up shop (1997)
Looking up two prices in Formulas.db (1997)
Question about replacing words (1998)
Updating a database once per day - An example (1998)
two forms of delivery (1998)