Ninjakreborn Posted November 14, 2006 Share Posted November 14, 2006 Is there a way to make checkboxs go back to default based on session settings.I have a form that's in 3 parts, the first 2 part's were basic drop downs and text fields. The last one has 2 huge sections of select boxes and 1 section of dropdowns.I was wondering when they go to the next page, and I validate the field's, if I have them come back to correct there error's is there a way to have the one's that were chosen previously to be selected as well, or is that not possible. Quote Link to comment Share on other sites More sharing options...
Orio Posted November 14, 2006 Share Posted November 14, 2006 You can set-$_SESSION['checkboxes']['0']= 1/0$_SESSION['checkboxes']['1']= 1/0$_SESSION['checkboxes']['2']= 1/0etc'So every checkbox will have it's variable, and it's value will be 1 if it was checked. When you "come back to correct their error" you can echo "checked" inside the <input> tag if it's 1, or echo nothing if it's 0 :)Orio. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.