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 MarquardtDesigner/Resident WireheadToast Design300 First Avenue North, Suite 150Minneapolis MN 55401612.330.9863 v612.321.9424 fwww.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 MarquardtDesigner/Resident WireheadToast Design300 First Avenue North, Suite 150Minneapolis MN 55401612.330.9863 v612.321.9424 fwww.toastdesign.com
Rob Marquardt
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...