Check boxes toggle using form.submit()

Hi guyz, when a checkkbox is clicked other than “form.locAll”, it should store the value of those form.location in a session so that I can use them during the session. By default form.locAll is checked… The problem is: if any other cb is checked, when I clicked the “All” cb it doesnt reset other form.location cboxes. Basically it should toggle between form.locAll and form.location.

Thank you alll.

----------Code----

<cfparam name=“form.location” default=“”>
<cfparam name=“session.location” default=“All”>
<cfparam name=“url.reset” default=“0”>
<cfparam name=“url.location” default=“All”>

<cfif isdefined(‘form.LocAll’) and trim(form.LocAll) eq “All” and not isdefined(‘form.location’)>
<cfset form.location = “”>
<cfelseif isdefined(‘form.location’) and form.location neq “”>
<cfset session.location = form.location>
</cfif>

<form>

      &lt;cfoutput query="GetDivisions"&gt;
      &lt;input type="checkbox" name="&lt;cfif trim(division) eq "All"&gt;LocAll&lt;cfelse&gt;location&lt;/cfif&gt;"  id="#trim(DIVISION)#" value="#trim(DIVISION)#"          onClick="document.LOAAcc.submit();"
      &lt;cfif form.location eq "" and trim(division) eq "All"&gt;
       checked="checked"
      &lt;cfelse&gt;
       &lt;cfloop list="#form.location#" index="a"&gt;
        &lt;cfif trim(a) eq trim(DIVISION)&gt;checked="checked"&lt;/cfif&gt;
       &lt;/cfloop&gt;
      &lt;/cfif&gt; 
       &gt;
      &lt;label for="#DIVISION#"&gt;#DIVISION#&lt;/label&gt;
      &lt;/cfoutput&gt;

</form>

it is resolved. thnak u all

If you’re going to post the same question to multiple forums, it would be nice if you also posted the final answer in all of those places :slight_smile: Just in case someone is searching for the same answer, but finds this thread … and not the others.