Sticky Checkboxes array
Posted: Mon Sep 19, 2011 6:32 pm
I need help making an array of checkboxes sticky. This is what I am trying to use.
But this does only seems to work when it is not an array, all boxes get checked when the submit button is clicked. I would like to use an array because of validations purposes.
Any help is appreciated. Thank you in advance.
Code: Select all
<?php
<input type="checkbox" name="submissions[]" value="Email" id="submit_email"' . ((isset($_POST['submissions']) == 'Email' ) ? ' checked="checked"' : '' ) . ' />
Submit via Email
<br />
<input type="checkbox" name="submissions[]" value="Person" id="in_person"' . ((isset($_POST['submissions']) == 'Person' ) ? ' checked="checked"' : '' ) . ' />
Submit Resume in Person
<br />
<input type="checkbox" name="submissions[]" value="Pick up App." id="pick_up"' . ((isset($_POST['submissions']) == 'Pick up App.' ) ? ' checked="checked"' : '' ) . ' />
Pick-up application
<br />
<input type="checkbox" name="submissions[]" value="Visit Web" id="visit_web"' . ((isset($_POST['submissions']) == 'Visit Web' ) ? ' checked="checked"' : '' ) . ' />
Visit Company Website
<br />
<input type="checkbox" name="submissions[]" value="" id="otherbox" />
Other: <input type="text" name="othertext" id="other" value="" size="20" maxlength="20" />
<br /> ';
?>
Any help is appreciated. Thank you in advance.