limecity Posted May 3, 2007 Share Posted May 3, 2007 I am doing a booking form. 1st page of the php is a simplified page 2nd page will be a more detail form where the user is require to fill in particulars I manage to get the input of the form into the 2nd page which uses dropdown menu. but I got problem with the radio button. for further explaination, this is what I did with the dropdown selection, and it worked. page 1 <select name="putime" id="putime"> <option value="12:00" selected="selected">12:00</option> <option value="12:30">12:30</option> <select> page 2 <select name="putime" id="putime"> <option value="12:00" <?php if($_POST['putime']=="12:00") echo " selected" ?>> 12:00</option> <option value="12:30" <?php if($_POST['putime']=="12:30") echo " selected" ?>>12:30</option> </select> ----------------------------- but how do i do the same for a two radio button? page 1 <input type="radio" id="puSession" value="am" name="Pickup_session" /> AM <input type="radio" id="puSession" value="pm" name="Pickup_session" /> PM page 2 ????? Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted May 3, 2007 Share Posted May 3, 2007 You would just grab the value they selected on the page the form is targeted towards like this: $Pickup_session = $_POST['Pickup_session']; Not sure if that answers your question or not... Quote Link to comment Share on other sites More sharing options...
limecity Posted May 3, 2007 Author Share Posted May 3, 2007 yea i am trying to grab the value i had on the previous page and show it on the next page. trying to do this for two radio buttons in one block of a table. hmm how do i insert the coding exactly I did try but i could be missing some tags or something: <input type="radio" <?php $Pickup_session = $_POST['Pickup_session'] ?>>AM <input type="radio" <?php $Pickup_session = $_POST['Pickup_session'] ?>>PM *i am a noob* Quote Link to comment Share on other sites More sharing options...
limecity Posted May 4, 2007 Author Share Posted May 4, 2007 <bump> Quote Link to comment Share on other sites More sharing options...
underparnv Posted May 4, 2007 Share Posted May 4, 2007 <input type="radio" name="whatever" checked="checked"> This is a checked Radio The same code (checked="checked") works for checkboxes as well. Hope that is what you are looking for... Quote Link to comment Share on other sites More sharing options...
limecity Posted May 5, 2007 Author Share Posted May 5, 2007 it worked ! it worked ! thank you very much :-D i learn something new today. Yea~ 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.