Re: Design Help Needed

This WebDNA talk-list message is from

1998


It keeps the original formatting.
numero = 20342
interpreted = N
texte = On 10/8/98 3:40 PM, charles kline so noted...>This looks great, only do to my lack of a Full understanding of WebCat >I was hoping you could explain your syntax a little more, if you have >time. I am not replacing with a context on the next page. This is a >straight-up replace to a database. > >
> > > > >Swimming Pool > > >
Doh! Commands! : )I don't know if you had seen it a couple weeks back -- in part of a message I mentioned how I always use contexts instead of commands so I'm not as familiar with command structure (always seems to be at least three different ways of doing something with commands : )That being said, your snippet above looks on the right track except when doing a replace (as opposed to an append), you need to tell it what record you're wanting to replace. Something like:Also, you won't be able to store the checkbox information as T/F when using a command like this. If somebody checks the Swimming Pool box, T will be stored in the database, if not, [SwimmingPool] will be saved (or possibly just -- my lack of command familiarity showing again).That's one of the reasons I prefer contexts, You can do pre-processing and validity checking on information before storing it somewhere. Of course, it's not absolutely necessary to store T/F for the value. Just treat it as if it's 'T' it's true, anything else, it's false.>So I figure I will use this example that you sent along to me: > >>If your checkboxes in the form were named such as: >> >> >> >> >> > >Which means that I will change the names to start with an '_' > >I think I have that much. But then I get a little lost here: > >>then the following would add their values (as T or F) to a database: >> >>[append db=whatever.db]......[formvariables >>name=_&exact=F]&[name]=[showif [value]=T]T[/showif][showif >>[value]!T]F[/showif][/formvariables]........[/append] > >I guess this loops through the form variables and evaluatrs all that >start with '_'?Since exact=F in this example, the formvariables loop will show any passed variables that have a _ anywhere in the name. If you have other elements in the form with underscores in their names that *aren't* checkboxes you want processed in this way (I think PCS' latest example sites have underscores in front of *all* variables) you could add more characters to ensure the name would be unique, such as: and then:[replace db=xxx.db&eqSKUdata=[SKU]&append=T].....[formvariables name=_Chk&exact=F]&[name]=[showif [value]=T]T[/showif][showif [value]!T]F[/showif][/formvariables][/replace]Note the changes to make the replace work like the command version. Now, if the SKU that's being passed is generated by [DATE %m%d%y][TIME %H%M%S] this context will *always* function as an append, since no matches for SKU will ever be found, except on The Day The Earth Stood Still.>This is going to replace my existing append? I am not sure how to >implement this on my page. I know that this is just a snippit, but seeing >what I already have from above, where does this go?If you're using a context like this, you'd remove all command references from your form and place the context (the [replace] line shown above) into your add1.tpl page>Thanks very much for your reply. I beleive this is exactly what I want to >do, just not 100% on the how-to part.Hopefully this makes it a *little* clearer (and not more confusing : )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: Design Help Needed (Rob Marquardt 1998)
  2. Re: Design Help Needed (PCS Technical Support 1998)
  3. Re: Design Help Needed (charles kline 1998)
  4. Re: Design Help Needed (Rob Marquardt 1998)
  5. Re: Design Help Needed (Howard Wolosky 1998)
  6. Re: Design Help Needed (charles kline 1998)
  7. Re: Design Help Needed (charles kline 1998)
  8. Re: Design Help Needed (charles kline 1998)
  9. Re: Design Help Needed (PCS Technical Support 1998)
  10. Re: Design Help Needed (Laurent Pladys 1998)
  11. Design Help Needed (charles kline 1998)
On 10/8/98 3:40 PM, charles kline so noted...>This looks great, only do to my lack of a Full understanding of WebCat >I was hoping you could explain your syntax a little more, if you have >time. I am not replacing with a context on the next page. This is a >straight-up replace to a database. > >
> > > > >Swimming Pool > > >
Doh! Commands! : )I don't know if you had seen it a couple weeks back -- in part of a message I mentioned how I always use contexts instead of commands so I'm not as familiar with command structure (always seems to be at least three different ways of doing something with commands : )That being said, your snippet above looks on the right track except when doing a replace (as opposed to an append), you need to tell it what record you're wanting to replace. Something like:Also, you won't be able to store the checkbox information as T/F when using a command like this. If somebody checks the Swimming Pool box, T will be stored in the database, if not, [SwimmingPool] will be saved (or possibly just -- my lack of command familiarity showing again).That's one of the reasons I prefer contexts, You can do pre-processing and validity checking on information before storing it somewhere. Of course, it's not absolutely necessary to store T/F for the value. Just treat it as if it's 'T' it's true, anything else, it's false.>So I figure I will use this example that you sent along to me: > >>If your checkboxes in the form were named such as: >> >> >> >> >> > >Which means that I will change the names to start with an '_' > >I think I have that much. But then I get a little lost here: > >>then the following would add their values (as T or F) to a database: >> >>[append db=whatever.db]......[formvariables >>name=_&exact=F]&[name]=[showif [value]=T]T[/showif][showif >>[value]!T]F[/showif][/formvariables]........[/append] > >I guess this loops through the form variables and evaluatrs all that >start with '_'?Since exact=F in this example, the formvariables loop will show any passed variables that have a _ anywhere in the name. If you have other elements in the form with underscores in their names that *aren't* checkboxes you want processed in this way (I think PCS' latest example sites have underscores in front of *all* variables) you could add more characters to ensure the name would be unique, such as: and then:[replace db=xxx.db&eqSKUdata=[SKU]&append=T].....[formvariables name=_Chk&exact=F]&[name]=[showif [value]=T]T[/showif][showif [value]!T]F[/showif][/formvariables][/replace]Note the changes to make the replace work like the command version. Now, if the SKU that's being passed is generated by [DATE %m%d%y][TIME %H%M%S] this context will *always* function as an append, since no matches for SKU will ever be found, except on The Day The Earth Stood Still.>This is going to replace my existing append? I am not sure how to >implement this on my page. I know that this is just a snippit, but seeing >what I already have from above, where does this go?If you're using a context like this, you'd remove all command references from your form and place the context (the [replace] line shown above) into your add1.tpl page>Thanks very much for your reply. I beleive this is exactly what I want to >do, just not 100% on the how-to part.Hopefully this makes it a *little* clearer (and not more confusing : )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:

WebMerchant 1.6 and https (1997) Email notification to one of multiple vendors ? (1997) Re:multiple digests, please stop (1997) More on the email templates (1997) WebCat2b13 Mac plugin - [sendmail] and checkboxes (1997) textarea data entry and display (2000) Euro WebDNA Conference (2004) Help! WebCat2 bug (1997) possible to oscillate between a [redirect] and [authenticate] every other login attempt? (2000) Secure server question (1997) Formatting a .txt file (1998) Generating Options for a Form. (1997) Botched cart numbers in webmerchant 2.1x email with webcat 3 (1998) Menu to select product variations (1997) Dynamic Generation of PDFs? (2003) Frames and WebCat (1997) database paths/names, and a typo (1997) Limit to Field Length in DB (1998) Search wbrk (repost) (2001) Silly Question (2003)