Soulpieced
12-09-2003, 07:43 PM
Studying for final here. Anyone have any idea how I can get this to work. CMToInch button should put in the appropriate text in the inches text field, and vice versa.
.
<body>
<script language="JavaScript" type="text/javascript">
<!--
function CMToInch(CM) {
var Inch = CM / 2.54
}
function InchToCM(Inch) {
var CM = Inch * 2.54
}
// -->
</script>
<h1> Centimeter to Inch Conversion </h1>
<form name="form">
<table>
<tr>
<th width="100"> Centimeters </th>
<td colspan="5">
<input name="CM" type="text" size="5" maxlength="30">
<input type="button" name="CMToInch" value="CMToInch" onCLick="CMToInch()">
</td>
</tr>
<tr>
<th width="100"> Inches </th>
<td colspan="5">
<input name="Inch" type="text" size="5" maxlength="30">
<input type="button" name="InchToCM" value="InchToCM" onCLick="InchToCM()">
</td>
</tr>
</table>
</form>
</body>
</html>
.
<body>
<script language="JavaScript" type="text/javascript">
<!--
function CMToInch(CM) {
var Inch = CM / 2.54
}
function InchToCM(Inch) {
var CM = Inch * 2.54
}
// -->
</script>
<h1> Centimeter to Inch Conversion </h1>
<form name="form">
<table>
<tr>
<th width="100"> Centimeters </th>
<td colspan="5">
<input name="CM" type="text" size="5" maxlength="30">
<input type="button" name="CMToInch" value="CMToInch" onCLick="CMToInch()">
</td>
</tr>
<tr>
<th width="100"> Inches </th>
<td colspan="5">
<input name="Inch" type="text" size="5" maxlength="30">
<input type="button" name="InchToCM" value="InchToCM" onCLick="InchToCM()">
</td>
</tr>
</table>
</form>
</body>
</html>