Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    C to F Not Working

    I can't seem to get it to work.


    <html>
    <head>

    <script>

    function getInputAsText(_id){return document.getElementById(_id).value}
    function getInputAsNumber(_id){return parseFloat(document.getElementById(_id).value)}
    function setOutput(_id, _value){document.getElementById(_id).value = _value}

    function calculate()
    {

    var c
    var f

    c = getInputAsNumber("cbox")

    f = 1.8 * c + 32

    setOutput("fbox", f)

    }
    </script>

    </head>

    <body>

    Input Values:<br>
    degrees C <input id="cbox"><br>
    <input type ="submit" value="go" onclick="calculate()"><br>

    <br>
    Output value: <br>
    degrees F
    <input id="fbox">

    </body>

    </html>

  • #2
    New to the CF scene
    Join Date
    Jul 2014
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Fixed the issue.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •