Re: Passing radio check box value to itself...

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 33913
interpreted = N
texte = OK, now I think I get it. You only posted a snip of your code. I assume now that other code on myself.tpl takes the value of '__EXAMPLE' and applies it to a db field named 'EXAMPLE' (upon form submit), right? ...and the code snip you posted is wrapped in a [search] context so that the 'EXAMPLE' field value is available, right? New users who take advantage of storebuilder get something up and running faster than if they learned the hard way and coded from scratch, but at the loss of knowing what the heck is really going on under the hood.--[HTML] (considered OFF TOPIC)-- Radio buttons are usually used when you want some var to have one value OR another. (...to pass one value for that var1 OR another value for that var1...) A radio button (within a group of radio buttons who all have the same name) will uncheck itself when you check another radio button with the same name (same var).Checkboxes are usually used when you want some var to have one value (AND possibly another value, AND possibly another value...) (...to pass multiple values for that var1), or... Checkboxes are usually used when you want var1 to have some value or not, and var2 to have some value or not, and var3 to have some value or not... (...to maybe or maybe not pass a value for var1, and maybe or maybe not pass a value for var2, etc.) Checkboxes are independant of one another in the sense that you can check a box on or off whether or not other checkboxes are checked.If you want to be able to uncheck a radio button that has been checked by the [showif], then you either have to provide an alternate radio button with a different value but the SAME name, OR else you should use a checkbox instead of the radio button.Whether radio button or checkbox: the HTML form will only send var/value pairs (e.g. SomeVar=SomeValue) into the page indicated by the form action for the radios/checkboxes which ARE checked. --[/HTML]----[WEBCAT]-- Webcat receives whatever var/value pairs your HTML form has sent to it from the preceding page. It handles them according to your webat code and then returns the resulting HTML.If you have a db field named example BUT the variable that was passed into a page (a page that you believe is updating the example field properly) is actually called __example, AND somehow it still seems to work right, then it is probably because the [append] or [replace] (whatever is updating the db fields) has this within its confines: [formvariables name=__&exact=F][getchars start=3][name][/getchars]=[URL][value][/URL]&[/formvariables] right?That code in english: for each variable passed into this page via form or URL whose name starts with __ (2 underscores), return this code: (nameOFTheVar)=[URL](ValueOfTheVar)[/URL]&So take the example of the __example var that we pass in to such a page:[Replace db=some.db&eqKEYFIELDdatarq=[KEYFIELD]][formvariables name=__&exact=F][getchars start=3][name][/getchars]=[url][value][/url]&[/formvariables][/Replace], would become:[Replace db=some.db&eqKEYFIELDdatarq=[KEYFIELD]]example=[url]Y[/url]&[/Replace] which updates the 'example' field with a value of Y for the indicated record(s). --[/WEBCAT]--HTH. If that does explain things well enough that you now know how it works, would you mind helping the next new guy to come in here asking the same question? ;-)-JohnParker wrote:> On Thu, 29 Jun 2000 10:53:21 > John Butler wrote: > > Which is why it seems even more bizarre to me that Parker > > you are saying that the radio > > button (we usually don't call these checkboxes, which > > act differently) cannot be > > UNCHECKED after form submission (implying it is checked > > after you submit the form). > > Yes. The form submits to itself. I check the radio button > which of course sets my database field to Y (or whatever I > want in the value.. should I make it T... will then a > boolean be set? I'll look into that.. doesn't seem like it > would matter in this case). Then the resulting page (itself > again) shows the button checked because of the [showif] > snippet.. good that's what I want, but I cannot then uncheck > this button. So I need to tell the page somehow that if the > radio button _is_ checked then I want to be able to uncheck > it. I can use menu pulldown code very easily here as it's > simply a yes/no situation, but would like to use this more > compact solution if possible. > > Again the code I'm using (modified from storebuilder code.. > see below): > >
> [EXAMPLE]=Y]checked[/showif]>Example >
> > I think I may be confusing checkbox and radio button > functionality a bit here. Can someone reply with a > functioning radio button that sets values in a database > based on whether it's checked or not? Thanks... see below > still... > > > Assuming your [showif] is all on one line, then the > > syntax looks right, and so the > > radio button should *not* be checked after form > > submission since __EXAMPLE=Y, which > > does *not* mean EXAMPLE=Y. > [snip] > > > [example] and [__example] are not the same thing. > > I'm a little confused. This is only my 5th or 6th webcat > project so I'm just modifying the default StoreBuilder > /admin/products.inc to fit the current store I'm working on. > _Everywhere_ I see this __VARIABLE and [VARIABLE] accessing > the same information. ex. > etc. So I'm just mimicing the default code. It works... > always has. I understand the logic of what you're saying of > course with the naming conventions. So I'm sure you can see > why I'm a little confused since this code is everywhere I > look. ;) > > ------------------------------------------------------------- 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 Web Archive of this list is at: http://search.smithmicro.com/ Associated Messages, from the most recent to the oldest:

    
  1. Re: Passing radio check box value to itself... (Parker 2000)
  2. Re: Passing radio check box value to itself... (John Butler 2000)
  3. Re: Passing radio check box value to itself... (Parker 2000)
  4. Re: Passing radio check box value to itself... (John Butler 2000)
  5. Re: Passing radio check box value to itself... (Aaron Lynch 2000)
  6. Passing radio check box value to itself... (Parker 2000)
OK, now I think I get it. You only posted a snip of your code. I assume now that other code on myself.tpl takes the value of '__EXAMPLE' and applies it to a db field named 'EXAMPLE' (upon form submit), right? ...and the code snip you posted is wrapped in a [search] context so that the 'EXAMPLE' field value is available, right? New users who take advantage of storebuilder get something up and running faster than if they learned the hard way and coded from scratch, but at the loss of knowing what the heck is really going on under the hood.--[HTML] (considered OFF TOPIC)-- Radio buttons are usually used when you want some var to have one value OR another. (...to pass one value for that var1 OR another value for that var1...) A radio button (within a group of radio buttons who all have the same name) will uncheck itself when you check another radio button with the same name (same var).Checkboxes are usually used when you want some var to have one value (AND possibly another value, AND possibly another value...) (...to pass multiple values for that var1), or... Checkboxes are usually used when you want var1 to have some value or not, and var2 to have some value or not, and var3 to have some value or not... (...to maybe or maybe not pass a value for var1, and maybe or maybe not pass a value for var2, etc.) Checkboxes are independant of one another in the sense that you can check a box on or off whether or not other checkboxes are checked.If you want to be able to uncheck a radio button that has been checked by the [showif], then you either have to provide an alternate radio button with a different value but the SAME name, OR else you should use a checkbox instead of the radio button.Whether radio button or checkbox: the HTML form will only send var/value pairs (e.g. SomeVar=SomeValue) into the page indicated by the form action for the radios/checkboxes which ARE checked. --[/HTML]----[WEBCAT]-- Webcat receives whatever var/value pairs your HTML form has sent to it from the preceding page. It handles them according to your webat code and then returns the resulting HTML.If you have a db field named example BUT the variable that was passed into a page (a page that you believe is updating the example field properly) is actually called __example, AND somehow it still seems to work right, then it is probably because the [append] or [replace] (whatever is updating the db fields) has this within its confines: [formvariables name=__&exact=F][getchars start=3][name][/getchars]=[url][value][/URL]&[/formvariables] right?That code in english: for each variable passed into this page via form or URL whose name starts with __ (2 underscores), return this code: (nameOFTheVar)=[url](ValueOfTheVar)[/URL]&So take the example of the __example var that we pass in to such a page:[Replace db=some.db&eqKEYFIELDdatarq=[KEYFIELD]][formvariables name=__&exact=F][getchars start=3][name][/getchars]=[url][value][/url]&[/formvariables][/Replace], would become:[Replace db=some.db&eqKEYFIELDdatarq=[KEYFIELD]]example=[url]Y[/url]&[/Replace] which updates the 'example' field with a value of Y for the indicated record(s). --[/WEBCAT]--HTH. If that does explain things well enough that you now know how it works, would you mind helping the next new guy to come in here asking the same question? ;-)-JohnParker wrote:> On Thu, 29 Jun 2000 10:53:21 > John Butler wrote: > > Which is why it seems even more bizarre to me that Parker > > you are saying that the radio > > button (we usually don't call these checkboxes, which > > act differently) cannot be > > UNCHECKED after form submission (implying it is checked > > after you submit the form). > > Yes. The form submits to itself. I check the radio button > which of course sets my database field to Y (or whatever I > want in the value.. should I make it T... will then a > boolean be set? I'll look into that.. doesn't seem like it > would matter in this case). Then the resulting page (itself > again) shows the button checked because of the [showif] > snippet.. good that's what I want, but I cannot then uncheck > this button. So I need to tell the page somehow that if the > radio button _is_ checked then I want to be able to uncheck > it. I can use menu pulldown code very easily here as it's > simply a yes/no situation, but would like to use this more > compact solution if possible. > > Again the code I'm using (modified from storebuilder code.. > see below): > >
> [EXAMPLE]=Y]checked[/showif]>Example >
> > I think I may be confusing checkbox and radio button > functionality a bit here. Can someone reply with a > functioning radio button that sets values in a database > based on whether it's checked or not? Thanks... see below > still... > > > Assuming your [showif] is all on one line, then the > > syntax looks right, and so the > > radio button should *not* be checked after form > > submission since __EXAMPLE=Y, which > > does *not* mean EXAMPLE=Y. > [snip] > > > [example] and [__example] are not the same thing. > > I'm a little confused. This is only my 5th or 6th webcat > project so I'm just modifying the default StoreBuilder > /admin/products.inc to fit the current store I'm working on. > _Everywhere_ I see this __VARIABLE and [VARIABLE] accessing > the same information. ex. > etc. So I'm just mimicing the default code. It works... > always has. I understand the logic of what you're saying of > course with the naming conventions. So I'm sure you can see > why I'm a little confused since this code is everywhere I > look. ;) > > ------------------------------------------------------------- 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 Web Archive of this list is at: http://search.smithmicro.com/ John Butler

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 [search] with NT (1997) Banners and sort of random display (1997) Pithy questions on webcommerce & siteedit (1997) [WebDNA] Recurring Orders (2012) totals (1997) Setting a null value for reply to address using sendmail... (2001) Missing something simple?? (1998) Weird Math and SV (1997) [sendmail] and [formvariables] (1997) Max Record length restated as maybe bug (1997) [isfile] ? (1997) possible bug in unix version? (2000) WebCat2b15MacPlugin - showing [math] (1997) Cart Number Propagation (1997) Country & Ship-to address & other fields ? (1997) Note added to [sendmail] in Docs (2004) WebCat2 Append problem (B14Macacgi) (1997) Newbie Tax Question (1997) What is WebDNA (1997) Huge databases and RAM (1998)