Click to See Complete Forum and Search --> : form to form via url


catchup
07-02-2003, 11:23 PM
the alert properly display the "data" value but the "data" value won't add to the end of the URL:

var sum = parseInt(document.f1.age[j].value)
var data = ",(age="+sum+")";
document.f1.action="Education.htm?age="+sum+data;
alert (data)

the alert displays: ,(age="10") ///using 10 as a numeric form option value example

the url displays only: Education.htm?age=10

why doesn't the url display: Education.htm?age=10,(age="10")

requestcode
07-03-2003, 06:41 AM
This works for me:
<html>
<head>
<title>Test</title>
<script language="JavaScript">
function doAlert()
{
var sum = document.f1.age.value;
var data = ",(age="+sum+")";
document.f1.action="Education.htm?age="+sum+data;
alert (document.f1.action)
}
</script>
</head>
<body>
<form name="f1">
<input type="text" name="age" size="3">
<input type="button" value="Do alert" onClick="doAlert()">
</form>
</body>
</html>

Is that what you want?