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:

Re:no template caching (1997) Two stores, one server (1998) Server crash (1997) WCS Newbie question (1997) WebCat2b13MacPlugIn - [include] doesn't allow creator (1997) Email Formatting (1998) Using Applescript to process WebCatalog functions (1998) [WebDNA] shopping sites and the "old commerce tags" (2012) RE: Nested [SEARCH] and [REPLACE] problem. (1997) Need host (1998) Denying access by IP address (2000) Date search - yes or no (1997) item sorting (1997) Converting Esiting Html Table Forms to WebCat (1997) Webten&Webcat (1998) Job Posting (1998) Setting up shop (1997) Help! Strange happenings... (1997) Need Sample Template - just purchased (1997) Plugin or CGI or both (1997)