Re: [ShowIf] a either fields are blank
This WebDNA talk-list message is from 1998
It keeps the original formatting.
numero = 20532
interpreted = N
texte = At 10/19/98 7:27 am, Mike Eberly wrote:>But I have 10 fields which I would like for the customer to fill out. I>any of these are left blank, I would like something to show. How do you>indicate that if [eMail] or [FirstName] or etc... are blank, then show a>certain text?I don't know if it's the easiest way, but we use a couple variables, like so: The errflag variable keeps track of any required field left empty; incrementing errnum keeps track of which one. Like so: [showif [name]=] [showif [math]errflag[/math]=0] [/showif] [/showif] [showif [address]=] [showif [math]errflag[/math]=0] [/showif] [/showif]Then check for the errnum/errflag combos: [showif [math]errflag[/math]>0] Oops! You've forgotten to fill out a required field! Please use your browser's Back button and [showif [math]errnum[/math]=1] tell us your name. Thanks! [/showif] [showif [math]errnum[/math]=2] supply us with your mailing address. Thanks! [/showif] [/showif] [hideif [math]errflag[/math]>0] [/hideif]Like I say, there's probably an easier way.Brian3IP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Brian Willson Three Islands Presswillson@3ip.com http://www.3ip.com/
Associated Messages, from the most recent to the oldest:
At 10/19/98 7:27 am, Mike Eberly wrote:>But I have 10 fields which I would like for the customer to fill out. I>any of these are left blank, I would like something to show. How do you>indicate that if [eMail] or [FirstName] or etc... are blank, then show a>certain text?I don't know if it's the easiest way, but we use a couple variables, like so: The errflag variable keeps track of any required field left empty; incrementing errnum keeps track of which one. Like so: [showif [name]=] [showif
[math]errflag[/math]=0] [/showif] [/showif] [showif [address]=] [showif
[math]errflag[/math]=0] [/showif] [/showif]Then check for the errnum/errflag combos: [showif
[math]errflag[/math]>0] Oops! You've forgotten to fill out a required field! Please use your browser's Back button and [showif
[math]errnum[/math]=1] tell us your name. Thanks! [/showif] [showif
[math]errnum[/math]=2] supply us with your mailing address. Thanks! [/showif] [/showif] [hideif
[math]errflag[/math]>0] [/hideif]Like I say, there's probably an easier way.Brian3IP. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Brian Willson Three Islands Presswillson@3ip.com http://www.3ip.com/
Brian Willson
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:
[sendmail] and [formvariables] (1997)
Interfacing WC with mail server (1998)
Price problem (1997)
Unexpected error (1997)
Umm...about those log files? (Off Topic) (1997)
Secure Server (1997)
WebCat editing, SiteGuard & SiteEdit (1997)
Secure server question (1997)
WebCat on Alpha? (1997)
[WebDNA] problems with [protect] on new OSX lion install (2012)
Not really WebCat (1997)
[WebDNA] inputed text getting scrambled up in DB (2012)
CommandSecurity? (1997)
No Line Breaks Appearing (2000)
Custom Shipping Charges (1997)
Running _every_ page through WebCat ? (1997)
Image Sizes (2003)
WebCat for Site Search? (1997)
OFF-TOPIC: No messages since Saturday (1998)
[WebDNA] Sorry WebDNA server not running - September 2019 Edition (2019)