AR
katmac wrote:
Hi
I have a form with a list of checkboxes (http://mandatorymarketinginc.com/web/sample-01.png)
These checkbox values were previously saved to a table called "comp-profile-03-specialties" and I got code working on the html form to to check and if specialty selected the checkbox is checked.
On the html form checkboxes name is "specialties[]".
However my problem comes in when I want to update the checkboxes to account for the possibilities if the a checkbox is de-selected or another checkbox is added.
How would I go about doing this?
Thanks.
It would be sooo much easier to help if you would post the code.
<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***
AR
Since i don't know where you are with your code, i can only suggest you that before the form you collect relevant values with mysql query and check it while parsing the form:
echo '<option value="'.$var.'"'.($checked['value'] == $var ? ' selected="selected">' : '>').$name.'</option>'."\n";
This way saved and changed values are compared and changed or not with next submit...
<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***