droidus Posted July 2, 2011 Share Posted July 2, 2011 on a resigtration form, if there are errors on the form when it is submitted, it comes back, and asks you to fill in all the fields where there was an error. i am having trouble with a radio group, texta area, and drop down box. when the form is submitted with content in it, it should save it. but it comes back empty. for the last one (radio group) i wasn't sure how to do it... here is my code: <select name="state" value="<? if (isset($error)) { echo htmlentities($_POST['state']); } ?> <? if(isset($_SESSION['VBSRegistration2011state'])){ echo ($_SESSION['VBSRegistration2011state']); } ?>" /> <textarea name="medical" id="medical" cols="30" rows="10" value = "<? if (isset($error)) { echo htmlentities($_POST['medical']); } ?>" placeholder = "Medical/other information we need to know. (Please include food allergies)" /> <input type="radio" name="photographypermission" value="agree" id="photographypermission" /> I agree <br /> <input type="radio" name="photographypermission" value="disagree" id="photographypermission" /> I Disagree Link to comment https://forums.phpfreaks.com/topic/240917-field-set-error/ Share on other sites More sharing options...
WebStyles Posted July 2, 2011 Share Posted July 2, 2011 text areas have the following format: <textarea name="bla bla bla"> your text here </textarea> radio groups have this format: <input type="radio" name="bla bla bla" value="whatever" id="something" checked="checked" /> and dropdowns have this format: <select name=""> <option value="somevalue">Your Text Here</option> <option value="anothervalue" selected>Your Text Here</option> </select> the parts in bold are where you need to place your conditions and variables. hope this helps. Link to comment https://forums.phpfreaks.com/topic/240917-field-set-error/#findComment-1237519 Share on other sites More sharing options...
droidus Posted July 2, 2011 Author Share Posted July 2, 2011 sorry, i don't want them pre-selected. when there are errors in the form, i just want their choices for each question to be remembered if they were answered properly. Link to comment https://forums.phpfreaks.com/topic/240917-field-set-error/#findComment-1237530 Share on other sites More sharing options...
WebStyles Posted July 2, 2011 Share Posted July 2, 2011 remembering a <select> choice Iis pre-selecting it. where I put the items in bold, you need ti put your if statements and select if needed. Link to comment https://forums.phpfreaks.com/topic/240917-field-set-error/#findComment-1237532 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.