 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
mathangi
Joined: 17 Sep 2004 Posts: 3
|
Posted: Fri Sep 17, 2004 5:33 am help with radio button target |
|
|
|
Hello all,
I have a form with 2 radio buttons (select radio button 1 or 2) and a "Su
bmit" button.
If the user selects radio button 1, and clicks the "Submit" button, it w
ill go to page A.
If the user selects radio button 2, and clicks the "Submit" button, it w
ill go to page B.
Could somebody help me in doing this.
I am a novice to using forms, therefore your help is greatly appreciated.
Regards,
Mathangi |
|
mjpliv

Joined: 11 May 2004 Posts: 406 Location: Nova Scotia
|
Posted: Mon Sep 20, 2004 7:15 am |
|
|
|
| Where does the "submit" button sent the information? Corey may have a javascript answer to this question. |
|
mathangi
Joined: 17 Sep 2004 Posts: 3
|
Posted: Mon Sep 20, 2004 9:49 am radio buttons |
|
|
|
Hello,
Let me ask the question this way!!!
There is only one "submit" which I want to use for selecting either of the radio buttons. But upon selection of the radio buttons, each selection should go to a different web page.
I have a primitive way of doing it.
For ex: Write 2 forms, where action="respective url page" for each submit button.
Could somebody please help me.
Thanks
mathangi |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8316 Location: Castle Pines North, CO USA
|
Posted: Mon Sep 20, 2004 1:33 pm |
|
|
|
And what makes you think that? LOL
Well if I understand your question, you might try:
| Code: |
<form name="myForm" action="firstpage.php" method="get">
<input type="radio" name="r" value="firstpage.php" selected="selected" onclick="this.form.action=this.value;"> First Page<br>
<input type="radio" name="r" value="secondpage.php" onclick="this.form.action=this.value;"> Second Page<br>
<input type="submit" value="Submit">
</form> |
or
| Code: |
<form>
<input type="hidden" name="gotolink" value="#" />
<input type="radio" onClick="this.form.gotolink.value=this.value;" value="page1.html" />P1
<input type="radio" onClick="this.form.gotolink.value=this.value;" value="page2.html" />P2
<input type="button" value="Go!" onclick="document.location=this.form.gotolink.value;" />
<form> |
|
|
mathangi
Joined: 17 Sep 2004 Posts: 3
|
Posted: Tue Sep 21, 2004 5:21 am radio button |
|
|
|
Hello Corey Bryant
Thanks for your help. This is exactly what I wanted!!!!
Regards
Mathangi  |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8316 Location: Castle Pines North, CO USA
|
Posted: Tue Sep 21, 2004 5:26 am |
|
|
|
Flad that I could be of help. Good luck with it!  |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
|
 |
|
|
|
|
|
|
|