chadpsk
09-30-2003, 07:46 PM
Ok...why is this not working?
every time I try it the text fields won't change
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script language="JavaScript">
function fToC(var fTemp, var cTemp){
window.document.form1.C.value = (fTemp- 32) * 1.8;
}
function cToF(var fTemp, var cTemp){
window.document.form1.F.value = (cTemp * 1.8) + 32;
}
</script>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<h1>Convert Tempatures</h1>
<p> </p>
<form name="form1">
<p><strong>Type in a farenheit temp:</strong></p>
<p>
<input type="text" name="F" value="">
<input type="submit" name="Submit2" value="Convert to Celcius" onClick="fToC(F.value, C.value">
<br>
</p>
<p><strong>Type in a celcius temp:</strong></p>
<p>
<input type="text" name="C" value="">
<input type="submit" name="Submit" value="Convert to Farenhiet!" onClick="cToF(F.value, C.value">
</p>
</form>
<p> <br>
<br>
</p>
</body>
</html>
every time I try it the text fields won't change
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<script language="JavaScript">
function fToC(var fTemp, var cTemp){
window.document.form1.C.value = (fTemp- 32) * 1.8;
}
function cToF(var fTemp, var cTemp){
window.document.form1.F.value = (cTemp * 1.8) + 32;
}
</script>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<h1>Convert Tempatures</h1>
<p> </p>
<form name="form1">
<p><strong>Type in a farenheit temp:</strong></p>
<p>
<input type="text" name="F" value="">
<input type="submit" name="Submit2" value="Convert to Celcius" onClick="fToC(F.value, C.value">
<br>
</p>
<p><strong>Type in a celcius temp:</strong></p>
<p>
<input type="text" name="C" value="">
<input type="submit" name="Submit" value="Convert to Farenhiet!" onClick="cToF(F.value, C.value">
</p>
</form>
<p> <br>
<br>
</p>
</body>
</html>