|
-
Oct 2nd, 2000, 07:10 AM
#1
Hi all!
I have a few radiobuttons on a page, and further on on this page, I have a hyperlink to another page. Now when someone clicks the hyperlink, I want to send along the value of the radiobuttons (which radiobutton is checked) along, so it will be known at the destination page.
How do I do this?
Thanx!
-
Oct 2nd, 2000, 10:26 AM
#2
Fanatic Member
are you using asp ? if yes. put radio buttons within a form tag's and post it to the asp page. then change the link ref to javascript to submit the form or use a submit button instead
<FORM name="Myform" action="myasppage.asp" method="Post">
<Input type="Radio" name="Myradio" value="Yes">
<Input type="Radio" name="Myradio" value="No">
</FORM>
<a href="javascript:document.Myform.submit();">continue</a>
Then in the asp page do
Dim myvar
myvar = Request.Form("Myradio")
Hope this helps
Ian
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
-
Oct 3rd, 2000, 02:02 AM
#3
Read radiobutton value on the page itself
Thank you,
Yeah, that's the solution I also came up with after a while (and after I found out a hyperlink can be used to call a js function), but I was just wondering if there is a way to determine the value of which radiobutton is checked on the page itself. Coz with the solution given, you pass it on to the next page and there you read it.
Now I admit, this is not really a matter of making it work anymore, coz the solution given will take care of that, but more of principle, and maybe for if I ned something like that in the future somewhere.
But thanx a lot already for your answer. 
Marcel
-
Oct 3rd, 2000, 03:38 AM
#4
Fanatic Member
You can check to see which one is selected on that page by using a javascript as well.
<script language="javascript">
function checkradio()
{
dim i;
dim numofradiobuttons = 2;
for(i=0;i<=numofradiobuttons;i++)
{
if(document.myform.Myradio[i].checked == true)
{
alert("number" + i + "was selected");
}
}
}
</script>
Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|