Re: updating checkbox in a db

This WebDNA talk-list message is from

1998


It keeps the original formatting.
numero = 17659
interpreted = N
texte = >Hi, > >i am trying to create a template to edit a database with checkbox type >input. > >I tried using the following > [clim]!]checked[/showif]> CLIM > >With it I am able to check a field that was previously unchecked and the >upgrade is ok (the value is indeed checked when I look at the record), >but if I uncheck the checkbox and update the record the value of the >field is still on > >How should this be done ? On the page that follows the form page, look for this parameter in your replace context:&clim=[clim]... and replace it with this:[showif [clim]=on]&clim=on[/showif][showif [clim]!on]&clim=[/showif]This will reset the clim value in your database to nothing (a blank or null value) when the person does NOT check the checkbox, and it will set that value to on when the person DOES check the checkbox ... :)This is assuming that you are performing the database editing with a [replace] context, because you cannot use this solution if your form is replacing data via a command.Sincerely, Ken Grome 808-737-6499 WebDNA Solutions mailto:ken@webdna.net http://www.webdna.net Associated Messages, from the most recent to the oldest:

    
  1. Re: updating checkbox in a db (bob 1998)
  2. Re: updating checkbox in a db (PCS Technical Support 1998)
  3. updating checkbox in a db (Laurent Pladys 1998)
  4. Re: updating checkbox in a db (Kenneth Grome 1998)
>Hi, > >i am trying to create a template to edit a database with checkbox type >input. > >I tried using the following > [clim]!]checked[/showif]> CLIM > >With it I am able to check a field that was previously unchecked and the >upgrade is ok (the value is indeed checked when I look at the record), >but if I uncheck the checkbox and update the record the value of the >field is still on > >How should this be done ? On the page that follows the form page, look for this parameter in your replace context:&clim=[clim]... and replace it with this:[showif [clim]=on]&clim=on[/showif][showif [clim]!on]&clim=[/showif]This will reset the clim value in your database to nothing (a blank or null value) when the person does NOT check the checkbox, and it will set that value to on when the person DOES check the checkbox ... :)This is assuming that you are performing the database editing with a [replace] context, because you cannot use this solution if your form is replacing data via a command.Sincerely, Ken Grome 808-737-6499 WebDNA Solutions mailto:ken@webdna.net http://www.webdna.net Kenneth Grome

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:

Getting total number of items ordered (1997) WebMerchant 1.6 and SHTML (1997) a search based on ^(contains) (1998) Keep away (1997) How to archive....? (1998) Help formatting search results w/ table (1997) includes (2003) Grouping search fields, etc. (1997) BACKGROUND (2000) Emailer (WebCat2) (1997) Problems with [Applescript] (1997) [WebDNA] El Capitan (2017) [OT] Networking 3 printers wirelessly (2005) Forbidden CGI Error (1997) Field Problem (2000) Sandboxes & Kitty Litter trays (2003) OT: need perl help, and question about switches (2007) Db design question (relational vs. flat?) (1998) Old Style vs XML Syntax (2003) Non-Cart Files in Shopping Cart Folder (1997)