joshi_v Posted November 2, 2006 Share Posted November 2, 2006 Hello Everyone!I had a form with radio buttons.form is spreaded for 4 pages.and all the radio buttons are selected in that form(all in 4 pages).now my problem is when i post the form , it is not posting all the radio button values selected in the form.It is only posting the values of the page from where i am saving the form. But i need all the selected values.So please help me how to get all values?Thanks!Joshi. Link to comment https://forums.phpfreaks.com/topic/25902-problem-in-posting-values-from-different-pages-in-same-form/ Share on other sites More sharing options...
gmwebs Posted November 2, 2006 Share Posted November 2, 2006 You would either need to assign those POST values from page 1 as session variables in page 2 and then page 2 POST values as session variables in page 3 and then page 3 POST values as session variables in page 4 - or you would need to POST page 1 values again as hidden inputs on page 2 to page 3, and then hidden inputs from page 1, 2 & 3 to page 4. Link to comment https://forums.phpfreaks.com/topic/25902-problem-in-posting-values-from-different-pages-in-same-form/#findComment-118319 Share on other sites More sharing options...
joshi_v Posted November 2, 2006 Author Share Posted November 2, 2006 Yes.But there is one problem. If i use session or hidden variables..it won't reflect the changes if i make any, after assigning values to that variables.For some reason i can't use hidden variables. So pls tell me any other option if is there?Thanks!Joshi. Link to comment https://forums.phpfreaks.com/topic/25902-problem-in-posting-values-from-different-pages-in-same-form/#findComment-118328 Share on other sites More sharing options...
heckenschutze Posted November 2, 2006 Share Posted November 2, 2006 Example, using similar logic mentioned above...page1.php[code]<form action="page2.php" method="post"><label><input type="radio" name="radio1" value="a">Radio 1a</label><label><input type="radio" name="radio1" value="b">Radio 1b</label><label><input type="radio" name="radio1" value="c">Radio 1c</label></form>[/code]page2.php[code]<form action="page3.php" method="post"><label><input type="radio" name="radio2" value="a">Radio 2a</label><label><input type="radio" name="radio2" value="b">Radio 2b</label><label><input type="radio" name="radio2" value="c">Radio 2c</label><?php echo "<input type=\"hidden\" name=\"radio1\" value=\"". htmlentities($_POST["radio1"]) . "\">";?></form>[/code]ect...Implementing a 'back' feature is also simple, following this principle...ALTERNATIVLY, You could store the value of 'radio1' in the query string... ?radio1=x and get it from the $_GET superglobal. Link to comment https://forums.phpfreaks.com/topic/25902-problem-in-posting-values-from-different-pages-in-same-form/#findComment-118331 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.