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:
Major Security Hole (1998)
RAM variables (1997)
Resume Catalog ? (1997)
Databases inside [SHOWIF] (1998)
WebCatalog 2.0 b 15 mac (1997)
WebCatalog for guestbook ? (1997)
Webcatalog quitting (1997)
ShowNext (1997)
WebCat2b12 Mac.acgi--[searchstring] bug (1997)
WebMerchant 3.0 for Mac shipping now (1998)
Sku numbers (1997)
FORMS: Returning a specific page (1997)
Shipping Calculation Problem (1997)
REPOST: How do _you_ back up your db? (2000)
Formvariables and Sendmail? (2000)
REPLACE & MAX/STARTAT parameters doesn't work? (2000)
international time (1997)
Some Questions (1997)
Storing calculated data (2002)
Correlating the record found with the fieldname (2000)