Lotz
09-01-2003, 01:53 PM
Is it possible to have a form perform a different action depending on which radio button is checked?
For example, if I have 2 radio buttons "under 13 years" + "over 13 years", I would like that if under 13 is checked, the action is /cgi-bin/under13.cgi and if over 13 is checked, the action is /cgi-bin/over13.cgi.
It is working with a drop down list, put I would like to put radio button instead.
<SCRIPT LANGUAGE="JavaScript"><!--
function setAction() {
document.form.action = document.form.select.options[document.form.select.selectedIndex].value;
}
//--></SCRIPT>
Could you help me to configure it with radio buttons?
Thanks a lot
For example, if I have 2 radio buttons "under 13 years" + "over 13 years", I would like that if under 13 is checked, the action is /cgi-bin/under13.cgi and if over 13 is checked, the action is /cgi-bin/over13.cgi.
It is working with a drop down list, put I would like to put radio button instead.
<SCRIPT LANGUAGE="JavaScript"><!--
function setAction() {
document.form.action = document.form.select.options[document.form.select.selectedIndex].value;
}
//--></SCRIPT>
Could you help me to configure it with radio buttons?
Thanks a lot