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:
Final Receipt (1999)
2nd WebCatalog2 Feature Request (1996)
New site announcement + Showing once on a founditems (1997)
WebCat2 beta 11 - new prefs ... (1997)
Register First (2000)
FYI: virus alert (1996)
dates and hex formatting (1997)
[TaxableTotal] - not working with AOL and IE (1997)
What am I doing wrong? (2000)
RE: type 2 errors with ssl server (1997)
Pithy questions on webcommerce & siteedit (1997)
WCS Newbie question (1997)
Stumped (1999)
shipping costs (1997)
emailer (1997)
Sum of Quantities (1997)
Simple counter - how? (1997)
WebCat2: Items xx to xx shown, etc. (1997)
virtual domain service (1997)
OFF-TOPIC...list serve software for newsletter? (1998)