Link to home
Create AccountLog in
Avatar of MarleneAyers
MarleneAyers

asked on

PHP Sticky checkboxes

I have a form with a series of checkboxes. If the user does not complete other information on the form, user submits, the form is redisplayed and I want the completed fields to be sticky. (I think that is the right term fields already completed to redisplay) including the checkboxes.

<input type="checkbox" name='otherMarketing[]' value="membership" id="membership"  <?php if ($_REQUEST[otherMarketing][membership]=='membership') { echo "checked";} ?> />
                  
Avatar of snoyes_jw
snoyes_jw
Flag of United States of America image

You'd have to name the checkbox 'otherMarketing[membership]' for that to work as written.
ASKER CERTIFIED SOLUTION
Avatar of Roonaan
Roonaan
Flag of Netherlands image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer