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:

OPEN MARKET PATENTS SOUND ECOMMERCE ALARM (1998) 5.0 Preview Promotion Extension (2003) Un[url]ize (1999) details (2003) gateway application timeouts (1998) OT: Portland Oregon (2002) TCPConnect , can I get an example, pretty please. (2002) Criticism of WebCatalog: Keep It Coming! (1998) RE: protect tag on NT (1997) [WebDNA] Send a print command to a thermal printer? (2012) WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997) WCS Newbie question (1997) Looking up two prices in database? (1997) Shopping Cart Problem (1998) back button loses cart (update for ken) (2000) Problems getting parameters passed into email. (1997) Auto entering Friday's date in a field (2002) why is this line in GeneralStore? (1998) ConvertChars - german umlauts (1998) Quantity/price formula (1998)