I have the trial3.php code here.

choose 1
<input type='radio' name='name1'>edit<?php echo "<form action=trial.php></form>";?></br>
<input type='radio' name='name2'>GMT<?php echo "<form action=trial2.php></form>"; ?></br>
<input type='submit' name='SEND' value='send'>

echo "<form action=trial.php method=get></form>";
echo "<form action=trial2.php method=get></form>";

what i want is to have 2 radio button selections that act as a switch case. for example I clicked on GMT then when I clicked on submit button... the GMT calculation page will run. and if it is not, then it shows the other one... if u cannot get the point of my problem... pls tell me

8 Years
Discussion Span
Last Post by metalix

Each submit button belongs to a certain form tag. Your button belongs only to a parent <form> so while clicking nothing happens as the form has no action.

My suggestion would be to use a JavaScript and change the action link dynamically on the radio button check.

Sorry if I didn't get point of the problem...

Edited by Daiva: n/a


yes javascript would be the best for this.

document.getElementById("divtag").innerHTML="<form action=trial.php method=get></form>";

and just put <div id="divtag"></div> somewhere underneath and get rid of the original form action.

Obviously there is more javascript to go with it.
not really sure why you don't use if/else in your form handling script to merge all together. but not quite sure what you want to do.

hope this helps :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.