Date:  02/19/2004 09:17:55 PM Msg ID:  001869
From:  FoxWeb Support Thread:  001868
Subject:  Re: Resetting Check Box
The value of your checkbox field should always be the same (usually "1", or "True").  What you should be changing is the inclusion of the "checked" clause.  The following checkbox field will show up as checked by default:
 
<input type="checkbox" name="veteran" value="1" checked>
 
You could control the default state with something like the following:
 
<input type="checkbox" name="veteran" value="1" <%=IIF(Request.Form('veteran') = '1', 'checked', '')%>>
 

FoxWeb Support Team
support@foxweb.com email

Sent by Joe Goldsmith on 02/18/2004 09:01:37 PM:
In my appliication a user selects one or more checkboxes for processing. When the button is pressed the same page is reloaded and checks to see if the processing button was checked. It it was the I find out which boxes were checked and use their values in a parameteritized view. When the page writes with the results I would like the boxes that were checked to remain checked. So, how to I recheck the chosen boxes please? here is th ecode I have.
 
Page: editcasereferral.fwx
<%
**Set up variables and open tables
*** Ignore below unless form button is pressed
 
IF Request.FormCount("btnsearch") > 0
 SELECT cases
 **** OPEN P-View ******
 IF !USED('vmatchprovider')
  USE (M.UPATH)+"/pbscases!vmatchprovider" NODATA SHARED IN 0
 ENDIF
 SELECT vmatchprovider
 *** Get Value of Checkboxes ***
***is* vars used in p-view
 isService = Request.Form('PRSERVICE')
 isPanel = Request.Form('PANEL')
 isLanguage = Request.Form('LANGUAGE')
 
 =REQUERY()
 lnPRecs = RECCOUNT()
ENDIF
 
*** FROM HERE HOW DO I RESET THE CHECKBOXES TO "CHECKED" THAT WERE CHECKED? ***
%>
 
<HTML>
<HEAD></HEAD>
<BODY>
<FORM NAME=getmatch METHOD=post ACTION="editcasereferral.fwx">
  <TABLE CELLSPACING=1 width=100%>
    <TR>
      <TD COLSPAN=5><B><CENTER><FONT>Referral Information For <%=ALLTRIM(M.CACLFNAME)+" "+ALLTRIM(M.CACLLNAME)%><BR>Case # <%=ALLTRIM(M.CACASENO)%></FONT></CENTER></B>
     </TD>
    </TR>
    TR>
      <TD ALIGN="LEFT"><B>Choose Match Criteria</B></TD>
      <TD ALIGN="LEFT">
       <B>CASE SERVICE:<BR>
       <FONT COLOR="#000000"><%=ALLTRIM(M.CASERVICE)%></B></FONT>&nbsp;&nbsp;
         <INPUT TYPE="checkbox" VALUE=<%=(M.CASERVICE)%> NAME="PRSERVICE">
      </TD>
      <TD ALIGN="LEFT">
       <B>CASE PANEL:<BR>
       <FONT COLOR="#000000"><B><%=ALLTRIM(M.CAPANEL)%></B></FONT>&nbsp;&nbsp;
        <INPUT TYPE="checkbox" VALUE=<%=(M.CAPANEL)%> NAME="PANEL">
      </TD>
      <TD ALIGN="LEFT">
       <B>CASE LANGUAGE:<BR>
       <FONT COLOR="#000000"><B><%=ALLTRIM(M.CALANGUAGE)%></B></FONT>&nbsp;&nbsp;
       &nbsp;&nbsp;
          <INPUT TYPE="checkbox" VALUE=<%=(M.CALANGUAGE)%> NAME="LANGUAGE">
      </TD>
      <TD CLASS=PBSfields1 ALIGN="LEFT">
       <INPUT TYPE=SUBMIT NAME=btnsearch VALUE="Find Providers">
      </TD>
     </TR>
    </TABLE>
    </FORM>

</BODY>

</HTML>