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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.