msiedle
asked on
Radio button postback not quite working ...
Hi all
I have a radio button group that gives two options: yes and no, and I want to make my form postback when these are clicked ... (as I am using php to create dynamic forms based on user input)
I found out how (or so i thought) using this method:
<input onfocus="this.form.action= 'screen_3. php';this. form.submi t()" type="radio" name="lbnw" id="lbnw_no" value="no" />
<label for="lbnw_no">No</label>
<br />
<input onfocus="this.form.action= 'screen_3. php';this. form.submi t()" type="radio" name="lbnw" id="lbnw_yes" value="yes" />
<label for="lbnw_yes">Yes</label>
But while that causes a postback just like a form submission should, in Forefix it doesn't seem to remember the value of the radiobutton I just selected to cause the postback.
Eg. say the radio button is set to 'no' by default ...then I click 'yes' which causes the form to submit ...the value that is posted on the form submission is still 'no' in Firefox (works in IE though).
Does anyone know a way around this BESIDES me posting every variable in the query string like this:
<input onfocus="location.href='sc reen_3.php ?var1=blah &var2=blah ';" type="radio" name="ccpi" id="ccpi_no" value="no" />
<label for="ccpi_no">No</label>
<br />
<input onfocus="location.href='sc reen_3.php ?var1=blah &var2=blah ';" type="radio" name="ccpi" id="ccpi_yes" value="yes" />
<label for="ccpi_yes">Yes</label>
Cheers,
Mark
I have a radio button group that gives two options: yes and no, and I want to make my form postback when these are clicked ... (as I am using php to create dynamic forms based on user input)
I found out how (or so i thought) using this method:
<input onfocus="this.form.action=
<label for="lbnw_no">No</label>
<br />
<input onfocus="this.form.action=
<label for="lbnw_yes">Yes</label>
But while that causes a postback just like a form submission should, in Forefix it doesn't seem to remember the value of the radiobutton I just selected to cause the postback.
Eg. say the radio button is set to 'no' by default ...then I click 'yes' which causes the form to submit ...the value that is posted on the form submission is still 'no' in Firefox (works in IE though).
Does anyone know a way around this BESIDES me posting every variable in the query string like this:
<input onfocus="location.href='sc
<label for="ccpi_no">No</label>
<br />
<input onfocus="location.href='sc
<label for="ccpi_yes">Yes</label>
Cheers,
Mark
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I see a lot of people doing onfocus, but that's too early in the event game :)
ASKER
M