Re: Checkboxes

This WebDNA talk-list message is from

1998


It keeps the original formatting.
numero = 19216
interpreted = N
texte = On 7/30/1998 9:10 am, Charles Kefauver so noted...>>It would just have to be: >> >>>[theField]=1]CHECKED[/showif]> >> >>For whatever is processing this form, if the checkbox is checked, >>theField = 1. If it's not checked, the value will be undefined, so >>theField = [theField]. You may want to filter out these undefined >>values before adding them to your database. > >That is the problem, how do I filter these undefined values during a >[REPLACE] action? This means adding an intermediate page to filter all >this garbage. There must be an easier way to do it...You wouldn't need an intermediate page, just a [showif] in your [replace] context. For example:[replace db=product.db&eqSkuData=[someSKU]]theField=[showif [theField]=1]1[/showif][/replace]And even this wouldn't be necessary for your form as shown above to check its checkboxes properly. If the checkbox hasn't been checked, the literal value [theField] will be stored in product.db so the comparison [showif [theField]=1]CHECKED[/showif] will still work as expected. Using the [showif] to remove the raw [theField] value would result in that particular field in your record containing either 1 or nothing (instead of 1 or [theField]), but from a programming standpoint, it makes no difference either way. It *would* be less confusing if WebCatalog collapsed undefined values so they'd be blanks automatically, but that's not the way the current version works ; )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:

    
On 7/30/1998 9:10 am, Charles Kefauver so noted...>>It would just have to be: >> >>>[theField]=1]CHECKED[/showif]> >> >>For whatever is processing this form, if the checkbox is checked, >>theField = 1. If it's not checked, the value will be undefined, so >>theField = [theField]. You may want to filter out these undefined >>values before adding them to your database. > >That is the problem, how do I filter these undefined values during a >[replace] action? This means adding an intermediate page to filter all >this garbage. There must be an easier way to do it...You wouldn't need an intermediate page, just a [showif] in your [replace] context. For example:[replace db=product.db&eqSkuData=[someSKU]]theField=[showif [theField]=1]1[/showif][/replace]And even this wouldn't be necessary for your form as shown above to check its checkboxes properly. If the checkbox hasn't been checked, the literal value [theField] will be stored in product.db so the comparison [showif [theField]=1]CHECKED[/showif] will still work as expected. Using the [showif] to remove the raw [theField] value would result in that particular field in your record containing either 1 or nothing (instead of 1 or [theField]), but from a programming standpoint, it makes no difference either way. It *would* be less confusing if WebCatalog collapsed undefined values so they'd be blanks automatically, but that's not the way the current version works ; )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:

Multiple Ad databases? (1997) WebCatalog for guestbook ? (1997) referrer variable (1997) Separate SSL Server (1997) [WebDNA] Google like search (2016) WebCatalog 2.0 & WebDNA docs in HTML ... (1997) Who owns the code? (2002) WebCat2b12--[searchstring] bug (1997) RE: WebCat and image maps (1997) Thanks ! (1997) SiteEdit Pro Update Announcement (1997) Tax Moratorium Expiring (2001) Bug or syntax error on my part? (1997) New Guestbook Source (1997) Fun with dates (1997) [WebDNA] WebDNA.us site speed (2011) What am I missing (1997) Record size-suggestion (1998) ShowNext truncating passed variable?? (1997) Fun with Dates - revisited (1997)