Page 1 of 1

radio button staying selected after submit

Posted: Wed Dec 14, 2011 5:56 pm
by altec-webdeveloper
I've been racking my brain and have tried every suggestion Google has thrown at me in regards to keeping the selected radio buttons to stay selected once the form has been submitted. This is a $session based form, in which each logged in user will have the ability to fill out. I've been able to keep the data from the input and text fields to remain populated, but not the radio buttons; or the check-boxes for that matter. The selection of the radio button does save in the database column named 'quotationinsurance' but for the life of me, I cant keep the button selected! :-(

Below is a snip-it of the database column that is storing the selected information:

Column: quotationinsurance
Type: VARCHAR
Lenght/Values: 20
Default: None

Below is a snip-it of the radio buttons from my php form - formOneEdit.php

Code: Select all

<td width="24"><span class="med"> 
                            <input type="radio" name="quotationinsurance" value="<?php
			if($form->value("quotation") == ""){
				echo $session->userinfo['quotation'];
				echo 'quotation';
			}else{
				echo $form->value("quotation");
			}
			?>" class="btn" onMouseOver="hov(this,'btn btnhov')" onMouseOut="hov(this,'btn')" />
                            </span></td>
                          <td width="54"><span class="small">Insurance</span></td>
                          <td width="271"><span class="med">
                            <input type="radio" name="quotationinsurance" value="<?php
			if($form->value("insurance") == ""){
				echo $session->userinfo['insurance'];
				echo 'insurance';
			}else{
				echo $form->value("insurance");
			}
			?>" class="btn" onMouseOver="hov(this,'btn btnhov')" onMouseOut="hov(this,'btn')" />
                            </span></td>
Let me know if you have any, well; preferably new suggestions, because I have tried every suggestion from all the forums. From PHP echo Checked = checked to javascript onClick functions. None seem to work. This form also uses a process.php and a session.php file

If you need check out the form, I can set up a guest username and password so you can check it out if need be....

Any help would be appreciated

Re: radio button staying selected after submit

Posted: Sat Dec 17, 2011 5:50 am
by social_experiment