No sure where to post this, but I'm wondering whether there is any way to use a formula in HTML or Java etc.
One of my CUSTOMVAR's will relate to another figure I need to display e.g (CUSTOMVAR-8500)/3500 = Figure to be displayed.
I am half way there with a form (see below), but the result sits in a text box - any ideas how to make it look like standard text or another way of working it?
Thanks
Wyn
<script><!--
function boiler() {
var vDHW=document.radiatorcalculator.dhw.value;
var vRads=document.radiatorcalculator.rads.value;
var vOutput=document.radiatorcalculator.output.value;
var vNoOfRads=((vOutput-vDHW)/vRads)
document.radiatorcalculator.result.value=vNoOfRads.toFixed(0); }
//--></script>
<form method="post" name="radiatorcalculator">
<input type="hidden" name="dhw" size="2" value="8500">
<input type="hidden" name="rads" size="2" value="3500">
<input type="hidden" name="output" size="2" value="12000">
<input type="image" src="spacer.gif" border="0" width="1" height="10" name="Submit" value="Calculate" onLoad="JAVASCRIPT:boiler()">
<input type="text" name="result" size="1" maxlength="1" border="0" class="pagetext">
+ DHW
</form>
One of my CUSTOMVAR's will relate to another figure I need to display e.g (CUSTOMVAR-8500)/3500 = Figure to be displayed.
I am half way there with a form (see below), but the result sits in a text box - any ideas how to make it look like standard text or another way of working it?
Thanks
Wyn
<script><!--
function boiler() {
var vDHW=document.radiatorcalculator.dhw.value;
var vRads=document.radiatorcalculator.rads.value;
var vOutput=document.radiatorcalculator.output.value;
var vNoOfRads=((vOutput-vDHW)/vRads)
document.radiatorcalculator.result.value=vNoOfRads.toFixed(0); }
//--></script>
<form method="post" name="radiatorcalculator">
<input type="hidden" name="dhw" size="2" value="8500">
<input type="hidden" name="rads" size="2" value="3500">
<input type="hidden" name="output" size="2" value="12000">
<input type="image" src="spacer.gif" border="0" width="1" height="10" name="Submit" value="Calculate" onLoad="JAVASCRIPT:boiler()">
<input type="text" name="result" size="1" maxlength="1" border="0" class="pagetext">
+ DHW
</form>
Comment