[ic] [Checked]

Ed LaFrance interchange-users@lists.akopia.com
Wed Jun 13 19:53:00 2001


At 06:46 PM 06/13/2001 -0400, you wrote:
>I have 9 <input type="checkbox">'s
>By default none are checked. So far so good.
>if the user clicks it and submits it, it is fine, if there is a error the 
>page is displayed and they are given the errors of what they forgot to 
>fill out. boxes are still checked appropriately.
>
>IF they unclick one of the 9 boxes (which aren't required) and they submit 
>if the page is redrawn (cause of errors) the boxes are checked again.
>
>Checked the docs used some examples. no luck. I just need it so that if 
>they uncheck a box it stays unchecked.
>

You just need to explicitly reset the value after displaying the input:

<input type=checkbox name=foo value=1 [checked foo 1]> Foo
[value name=foo set='' hide=1]

That way, the next time the form is submitted, foo will be empty 
(unchecked) unless they check/leave checked the box.  Note: when you have 
multiple checkboxes for one variable name, this needs to change a bit:

<input type=checkbox name=foo value=1 [if value foo =~ /1/]checked[/if]> Foo 1
<input type=checkbox name=foo value=2 [if value foo =~ /2/]checked[/if]> Foo 2
... <!-- etc -->
[value name=foo set='' hide=1]

- Ed L.





===============================================================
New Media E.M.S.               Software Solutions for Business
463 Main St., Suite D          eCommerce | Consulting | Hosting
Placerville, CA  95667         edl@newmediaems.com
(530) 622-9421                 http://www.newmediaems.com
(866) 519-4680 Toll-Free       (530) 622-9426 Fax
===============================================================