Jump to content

Php and radio button


limecity

Recommended Posts

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

 

?????

Link to comment
https://forums.phpfreaks.com/topic/49849-php-and-radio-button/
Share on other sites

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*

Link to comment
https://forums.phpfreaks.com/topic/49849-php-and-radio-button/#findComment-244575
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.