Forum Moderators: open
I am a complete novice so it is probably something simple!
Not sure if i am allowed to post the script into this message?
Here is a section of the code i have used:
<form>
<script language="LiveScript">
function litres (form){
form.USGallons.value = form.litres.value * 0.2641720
form.UKGallons.value = form.litres.value * 0.2199694
}
</script>
<table>
<tr>
<td width="68">Litres</td>
<td width="90"><input type ="text" name="litres" size=15></td>
</tr>
<tr>
<td><input name="button" type ="button" onClick="litres(this.form)" value="Calculate"></td>
</tr>
<tr>
<td height="25">US Gallons</td>
<td><input name="USGallons" type="text" size=15></td>
</tr>
<tr>
<td height="24">UK Gallons </td>
<td><input name="UKGallons" type="text" size="15"></td>
</tr>
</table>
</form>
</td>
<td width="279" align="left" valign="top"><form>
<script language="LiveScript">
function calc (form){
form.BAR.value = form.psi.value * 0.0689476
}
</script>
<table width="175">
<tr>
<td width="70">PSI</td>
<td width="185"><input type ="text" name="psi" size=15></td>
</tr>
<tr>
<td align="left"><input name="button2" type ="button" onClick="calc(this.form)" value="Calculate"></td>
</tr>
<tr>
<td height="24">BAR</td>
<td><input name="BAR" type="text" size=15></td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td height="20" align="left" valign="top"> </td>
<td align="left" valign="top">Convert BAR to PSI </td>
</tr>
<tr>
<td height="89" align="left" valign="top"> </td>
<td align="left" valign="top"><form>
<script language="LiveScript">
function calc (form){
form.psi.value = form.bar.value * 14.5037744
}
</script>
<table width="175">
<tr>
<td width="70">BAR</td>
<td width="185"><input type ="text" name="bar" size=15></td>
</tr>
<tr>
<td align="left"><input name="button2" type ="button" onClick="calc(this.form)" value="Calculate"></td>
</tr>
<tr>
<td height="24">PSI</td>
<td><input name="psi" type="text" size=15></td>
</tr>
</table>
</form>