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:

unsubscribe (1997) includes and cart numbers (1997) [WebDNA] Emailer & SMTP (2009) Location of Browser Info.txt file (1997) Thanks ! (1997) HELP WITH DATES (1997) Strange intermittent WebDNA problems (2008) using showpage and showcart commands (1996) Add htmlarea 3 to SiteBuilder (2004) Running _every_ page through WebCat ? (1997) [isfile] ? (1997) Multiple Pulldowns (1997) Pricing based on quantity (2000) Browser Reloads and AddlineItem (1997) [format xs] freeze (1997) Emailer again & again (1997) SiteEdit Pro Update Announcement (1997) Prevent multiple appends with Reload Button (1997) $Replace with [founditems] (1997) [WebDNA] FindString - source: multiple words (2019)