Jump to content

Radio button value


luvburn

Recommended Posts

Ok... i have one page that have a recordset with radio button in it. The recordset only display 10 records. User will have to click 'next' button to see another 10 records and so on. How do i keep the value of radio button for each records cause whenever i go to the next page, the value from previous page disappear, the submit button is at the last page. I want to submit all radio buttons values to another page.
Link to comment
Share on other sites

Are you saying that you have a list of items and for each there are a two or more options that may be selected using radio buttons?

You will need to submit form values each page, but not as in processing the final values but you will need to submit to get the selected radio buttons into the session on the next page.

You will need to start or resume a session on the start of each page where you are using the form (if you are already using sessions in your script thats great!, you dont/cant start a second session)

[code]
<?php
sessionstart();
?>
[/code]

on each form page, you will need to take submitted form values and save to them to a session variable, so for example if you have a form input named 'inputone', you would use this:

[code]
$_SESSION['inputone'] = $_POST['inputone'];  // note to change to $_GET['inputone'] if get method used
[/code]

Do this for each form element on each page to store all values ready for submission.  Then when you are ready to submit and process all the data, just refer to each of the $_SESSION['input...'] variables for the required values.
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.