I think, the best way to do that is using a JavaScript function that is called on Submit, which then checks the value of the checkbox and sets the value of the hidden value. Even the simplest framework usually consists of hundreds of lines of code, and you don't need all that complexity for this simple task. I mean if you're going to resort to JavaScript programming, then might as well do it yourself:

<HTML> <BODY> <FORM NAME=MAIN METHOD=POST onSubmit="SUBMIT(); return false;" ACTION= +"https://www.mywebsite.com/form_receiver.pl"> <TABLE CELLSPACING=6> <TR> <TD><SELECT NAME=Type> <OPTION VALUE='Mr'>Mr <OPTION VALUE='Ms'>Ms <OPTION VALUE='Mrs'>Mrs </SELECT> <TD><INPUT TYPE=TEXT NAME=FirstName> <TD><INPUT TYPE=TEXT NAME=LastName> <TD><INPUT TYPE=CHECKBOX NAME=MemberChecked> <INPUT TYPE=HIDDEN NAME=Member> <TR> <TD>Type <TD>First Name <TD>Last Name <TD>Member <TD>Class </TABLE> <INPUT TYPE=SUBMIT VALUE="Submit"> <INPUT TYPE=BUTTON VALUE="LoadValueSet1" onClick='LoadValues1();'> <INPUT TYPE=BUTTON VALUE="LoadValueSet2" onClick='LoadValues2();'> <INPUT TYPE=BUTTON VALUE="Reset" onClick="ResetFormValues();"> </FORM> <SCRIPT> ResetFormValues(); function ResetFormValues() { SetFormValues(0, '', '', 0); document.MAIN.FirstName.focus(); document.MAIN.FirstName.select(); } function SUBMIT() { if (!ValidateForm()) { return 0; } DisplayForm(); document.MAIN.submit(); } function ValidateForm() { if (DontLeaveBlank(document.MAIN.FirstName, "First Name")) { return +0; } if (DontLeaveBlank(document.MAIN.LastName, "Last Name")) { return 0; + } document.MAIN.Member.value = (document.MAIN.MemberChecked.checked) ? + 1 : 0; return 1; } function DontLeaveBlank(OBJ, Name) { var IsEmpty = !/[a-zA-Z]+/.test(OBJ.value); if (IsEmpty) { alert(Name + " cannot be left blank."); OBJ.focus(); OBJ.select(); } return IsEmpty; } function SetFormValues(_Type, _FirstName, _LastName, _Member) { with (document.MAIN) { Type.selectedIndex = _Type; FirstName.value = _FirstName; LastName.value = _LastName; MemberChecked.checked = _Member; } } function DisplayForm() { alert("GETTING READY TO SUBMIT FORM\n" + "\nType = '" + document.MAIN.Type.value + "\nTypeSel = '" + document.MAIN.Type.selectedIndex + "'\nFirstName = '" + document.MAIN.FirstName.value + "'\nLastName = '" + document.MAIN.LastName.value + "'\nMember = " + document.MAIN.Member.value); } function LoadValues1() { SetFormValues(0, "JOHNNY", "SMITH", 1); } function LoadValues2() { SetFormValues(2, "JULIA", "BROWN", 0); } </SCRIPT>

In reply to Re: Edge case for checkboxes when used to update data records by harangzsolt33
in thread Edge case for checkboxes when used to update data records by davebaker

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.