In article <11*********************@o13g2000cwo.googlegroups. com>,
bf******@texarkanacollege.edu enlightened us with...
Here is exactly what I want to do:
-------------------------------------------------------------------
<head>
<title>Test HREF with RADIO buttons</title>
<SCRIPT LANGUAGE="JavaScript">
<script type="text/javascript">
Language attribute is deprecated.
<!--
Don't need to comment it out any more. That went out of need with Netscape 3
or some such.
Just extra bytes in a file now.
function WhichButton()
{
var choice1 = eval("document.myform.choice[0].checked")
Eeek!
Eval is Evil. ;)
choice1 = document.myform.choice[0].checked;
should be just fine. The checked property is true or false anyway. No need
for eval. Actually, there is very, very rarely a need for the resource
glutton that is called eval.
Actually, see script below. You don't need it at all.
<a href="next.cgi?code=javascript:WhichButton()&other =abc">ABC</a><br>
Unfortunately, you can't do this.
As long as you're using javascript, do it all the way. ;)
I assume from your post that there is always only one 'other' value and it's
the only additional parameter.
Also note that radio buttons mean you always expect one value. That means one
should be checked by default. So I put that here.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title> New Document </title>
</head>
<body>
<script type="text/javascript">
function go(otherval)
{
document.myform.other.value=otherval;
document.myform.submit();
}
</script>
</head>
<form name="myform" action="next.cgi" method="get">
Choice 1<input type="radio" name="choice" value=1 checked><br>
Choice 2<input type="radio" name="choice" value=2><br>
<input type="hidden" name="other" value="">
</form>
<hr>
<a href="#" onClick="go('abc'); return false;">ABC</a><br>
<a href="#" onClick="go('xyz'); return false;">XYZ</a><br>
<hr>
</body>
</html>
--
--
~kaeli~
Reading while sunbathing makes you well red.
http://www.ipwebdesign.net/wildAtHeart http://www.ipwebdesign.net/kaelisSpace