Re: 3.0 [TEXT] variables

This WebDNA talk-list message is from

1998


It keeps the original formatting.
numero = 20498
interpreted = N
texte = On 10/15/98 4:57 PM, Dave MacLeay so noted...>A simple example would be a form with several checkboxes. Currently there >is a lot of code out there that deals with it like this: > > [Append ...]CheckBox1=[ShowIf >[CheckBox1]=[raw][CheckBox1][/raw]]F[/ShowIf][HideIf >[CheckBox1]=[raw][CheckBox1][/raw]][CheckBox1]&CheckBox2=[ShowIf >[CheckBox2]=[raw][CheckBox2][/raw]]F[/ShowIf][HideIf >[CheckBox2]=[raw][CheckBox2][/raw]][CheckBox2][/Append] > >Every time you want to use a checkbox value, you have to go through the >whole [ShowIf]/[HideIf] routine again. What a drag.I had mentioned something to this effect last week on the subject of adding the information from a large number of radio buttons to a database. If you absolutely *have* to define the T/F value for a checkbox, it could be simplified as:[Append ...]CheckBox1=[ShowIf [CheckBox1]!T]F[/ShowIf][ShowIf [CheckBox1]=T]T[/ShowIf]&CheckBox2=[ShowIf [CheckBox2]!T]F[/ShowIf][ShowIf [CheckBox2]=T]T[/ShowIf][/Append]... resulting in far fewer [raw][variable][/raw] tags which, imho, makes it easier to track -- but I'd agree that it's still a drag : )Another way to consider would be to just do:[Append ...]CheckBox1=[CheckBox1]&CheckBox2=[CheckBox2][/Append]Then, when it comes time to use that information to repopulate a form, or cause some action to occur, just think of it as if the value is 'T' it's true, if it's anything else, it's false.Keeping in mind Grant's recent emphatic closure of the whole default value of undeclared variables subject, I'm *not* getting into *that* whole can of worms again! ; )Rob Marquardt Designer/Resident Wirehead Toast Design300 First Avenue North, Suite 150 Minneapolis MN 55401 612.330.9863 v 612.321.9424 f www.toastdesign.com Associated Messages, from the most recent to the oldest:

    
  1. Re: 3.0 [TEXT] variables (Kenneth Grome 1998)
  2. Re: 3.0 [TEXT] variables (Grant Hulbert 1998)
  3. Re: 3.0 [TEXT] variables (Christer Olsson 1998)
  4. Re: 3.0 [TEXT] variables (Michael Winston 1998)
  5. Re: 3.0 [TEXT] variables (Grant Hulbert 1998)
  6. Re: 3.0 [TEXT] variables (Rob Marquardt 1998)
  7. Re: 3.0 [TEXT] variables (Dave MacLeay 1998)
  8. 3.0 [TEXT] variables (Michael Winston 1998)
On 10/15/98 4:57 PM, Dave MacLeay so noted...>A simple example would be a form with several checkboxes. Currently there >is a lot of code out there that deals with it like this: > > [Append ...]CheckBox1=[ShowIf >[CheckBox1]=[raw][CheckBox1][/raw]]F[/ShowIf][HideIf >[CheckBox1]=[raw][CheckBox1][/raw]][CheckBox1]&CheckBox2=[ShowIf >[CheckBox2]=[raw][CheckBox2][/raw]]F[/ShowIf][HideIf >[CheckBox2]=[raw][CheckBox2][/raw]][CheckBox2][/Append] > >Every time you want to use a checkbox value, you have to go through the >whole [showif]/[hideif] routine again. What a drag.I had mentioned something to this effect last week on the subject of adding the information from a large number of radio buttons to a database. If you absolutely *have* to define the T/F value for a checkbox, it could be simplified as:[Append ...]CheckBox1=[ShowIf [CheckBox1]!T]F[/ShowIf][ShowIf [CheckBox1]=T]T[/ShowIf]&CheckBox2=[ShowIf [CheckBox2]!T]F[/ShowIf][ShowIf [CheckBox2]=T]T[/ShowIf][/Append]... resulting in far fewer [raw][variable][/raw] tags which, imho, makes it easier to track -- but I'd agree that it's still a drag : )Another way to consider would be to just do:[Append ...]CheckBox1=[CheckBox1]&CheckBox2=[CheckBox2][/Append]Then, when it comes time to use that information to repopulate a form, or cause some action to occur, just think of it as if the value is 'T' it's true, if it's anything else, it's false.Keeping in mind Grant's recent emphatic closure of the whole default value of undeclared variables subject, I'm *not* getting into *that* whole can of worms again! ; )Rob Marquardt Designer/Resident Wirehead Toast Design300 First Avenue North, Suite 150 Minneapolis MN 55401 612.330.9863 v 612.321.9424 f www.toastdesign.com Rob Marquardt

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:

Multiple prices (1997) Using [purchase] (1998) setlineitem quantity to zero? (2000) pc (1997) Date problems (1997) Nested tags count question (1997) [WebDNA] php/mySQL version of WebDNA Speed Test? (2009) code to phantom spacing (2001) New commands in Final candidate (1997) Searching on 3 different fields *CORRECTION* (2003) Check for OS (2003) ShipCost Data Base (1998) Summary search -- speed (1997) [WebDNA] table comma field delimiter bug? (2012) syntax question, not in online refernce (1997) PROBLEM (1997) What date is it anyway? (2004) Problem with Setheader (2001) (1998) WebCatalog2 Feature Feedback (1996)