Announcement

Collapse
No announcement yet.

HTML formula

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    HTML formula

    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>
    www.firesonline.co.uk
    The wood burning stove specialists.

    #2
    document.write?
    Bill
    www.egyptianwonders.co.uk
    Text directoryWorldwide Actinic(TM) shops
    BC Ness Solutions Support services, custom software
    Registered Microsoft™ Partner (ISV)
    VoIP UK: 0131 208 0605
    Located: Alexandria, EGYPT

    Comment


      #3
      Either

      1) Don't use a form field for the result. Instead make your output field like this

      <div id="result">&nbsp;</div>

      and in your JavaScript you can use

      document.getElementById('result').innerHTML = vNoOfRads.toFixed(0);

      2) Use CSS to make the result form field look like the rest of the page.
      Norman - www.drillpine.biz
      Edinburgh, U K / Bitez, Turkey

      Comment


        #4
        Thanks guys, problem sorted. It's a lot easy when you know where to start looking.

        Wyn
        www.firesonline.co.uk
        The wood burning stove specialists.

        Comment

        Working...
        X