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 Grome808-737-6499WebDNA Solutionsmailto:ken@webdna.nethttp://www.webdna.net
Associated Messages, from the most recent to the oldest:
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 Grome808-737-6499WebDNA Solutionsmailto:ken@webdna.nethttp://www.webdna.net
Kenneth Grome
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...