Help with code! PLEASE!

M

MichiganMan

I have to do a simple temp conversion page in Javascript. I wrote code
that I thought was right, but it is not showing output after I click
the calculate button. Could someone PLEASE tell me what I am
missing???

<!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang = "en"
dir="ltr">
<head>
<title>Temperature Converter</title>

<script type="text/javascript">
<!-- HIDE FROM INCOMPATIBLE BROWSERS
/*
Project 9-2
*/
function calcCel(form){
form.celCon.value = ((form.far.value - 32) / 1.8));
}
function calcFar(form){
form.farCon.value = ((1.8 * form.cel.value) + 32));
}
// STOP HIDING FROM INCOMPATIBLE BROWSERS -->
</script>
</head>
<body><center>
<form name="calculator" action= "" method="get">
<h1>Temperature Converter</h1>
<table>
<tr>
<td>Fahrenheit Temperature</td>
<td><input type="text" name="far" size="6"></input></td>
<td><input type="button" value="Covert to Celsius"
onclick="calcCel(form)"></input></td>
<td><input type="text" name="celCon" size="6"></input></td>
</tr>
<tr>
<td>Celsius Tempurature</td>
<td><input type="text" name="cel" size="6"></input></td>
<td><input type="button" value="Convert to Fahrenheit"
onclick="calcFar(form)"></input></td>
<td><input type="text" name="farCon" size="6"></input></td>
</tr>
</table>
</form>
</center>
</body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,067
Latest member
HunterTere

Latest Threads

Top