converting ºC to ºF or ºF to ºC

Mark Mazer markmazerandfm13@earthlink.net
Mon, 09 Feb 2009 14:27:31 PST
Hi David,

Here is a repeat of a nifty little applet I first posted 5 or so years ago on this list:

If you insert the script that follows into a new web page, save it, and then 
open it in your browser one can readily convert C and F.


<HTML>

<HEAD>
 <BODY BGCOLOR="#FFFFFF">
<TITLE>Temperature Coversion</TITLE>
<H1> </H1>
 
<CENTER>
<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=5 WIDTH="100%" >

<TR>
<TD VALIGN=TOP>

<H3>Temperature Conversion</H2>

Enter a number in either field, then 

<ul><li>click outside the text box, or

    <li>press the tab key.

</ul>

<form>

F: 
<input type="text" name="F" value="32"

    onChange="eval('C.value = ' + this.form.C_expr.value)" size="20">

   <input type="hidden" name="F_expr" value="(212-32)/100 * C.value + 32 ">

    

C: 
<input type="text" name="C" value="0"

    onChange="eval('F.value = ' + this.form.F_expr.value)" size="20">

   <input type="hidden" name="C_expr" value="100/(212-32) * (F.value - 32 )">

    

   <input type=reset name=reset value=reset>

</form>

<P>



This script converts from celcius to fahrenheit and vice versa.

<P></TABLE>
</HTML>



More information about the pbs mailing list