I am writing my code here, it works but doesn't exactly show the result I want.
when I click submit button it shows the result in location bar and I want it to show the result in one of the form field named windch. I am new to javascript, please help!!!
Thanks a million in advance.
<html>
<head>
<script language="Javascript">
function calc(){
document.form1.windch.value = document.form1.outtemp.value - (document.form1.wind.value * 1.5);
if (document.form1.windch.value >= -10) {
document.form1.temp[0].checked = true
}
else if (document.form1.windch.value >= -20) {
document.form1.temp[1].checked = true
}
else {
document.form1.temp[2].checked = true
}
}
</script>
</head>
<body>
<form onSubmit="calc()" name="form1">
<input type=text name="outtemp"><br>
<input type=text name="wind"><br>
<input type=text name="windch"><br>
<input type=radio name=temp value=http://www.webdeveloper.com/forum/archive/index.php/beautiful>Beautiful skiing weather<br>
<input type=radio name=temp value=warm>Dress warm for skiing today<br>
<input type=radio name=temp value=frost>Possibility of frost bite<br>
<input type=submit value=submit>
</form>
</body>
</html>
when I click submit button it shows the result in location bar and I want it to show the result in one of the form field named windch. I am new to javascript, please help!!!
Thanks a million in advance.
<html>
<head>
<script language="Javascript">
function calc(){
document.form1.windch.value = document.form1.outtemp.value - (document.form1.wind.value * 1.5);
if (document.form1.windch.value >= -10) {
document.form1.temp[0].checked = true
}
else if (document.form1.windch.value >= -20) {
document.form1.temp[1].checked = true
}
else {
document.form1.temp[2].checked = true
}
}
</script>
</head>
<body>
<form onSubmit="calc()" name="form1">
<input type=text name="outtemp"><br>
<input type=text name="wind"><br>
<input type=text name="windch"><br>
<input type=radio name=temp value=http://www.webdeveloper.com/forum/archive/index.php/beautiful>Beautiful skiing weather<br>
<input type=radio name=temp value=warm>Dress warm for skiing today<br>
<input type=radio name=temp value=frost>Possibility of frost bite<br>
<input type=submit value=submit>
</form>
</body>
</html>