Click to See Complete Forum and Search --> : radiobuttons on my page..
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!
Ianpbaker
Oct 2nd, 2000, 10:26 AM
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
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
Ianpbaker
Oct 3rd, 2000, 03:38 AM
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>
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.