SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    .net install meltdown
    Join Date
    May 2001
    Location
    View Ridge
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simple math question

    I'm trying to multiply two values from a form and display the result.
    This seems like it'd be easy, but I can't seem to get it to work.
    Code:
    <html>
    
    <head>
    
    <title></title>
    
    <script language="JavaScript">
    <!--
    
    function calc()
    {
    	document.DetTime.time=(document.DetTime.level * document.DetTime.flow);
    }
    -->
    </script>
    
    </head>
    
    <body>
    
    <form name="DetTime">
      <input name="level" type="text" size="5"><p>Level</p>
      <input name="flow" type="text" size="5" onkeyup="calc()"><p>Flow</p>
      <input name="time" type="text" size="5"><p>Time</p>
      
    </form>
    
    </body>
    
    </html>
    Am I close or way off?

  2. #2
    .net install meltdown
    Join Date
    May 2001
    Location
    View Ridge
    Posts
    692
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Never mind...I'm a dork

    Found the problem, I was forgetting the ".value" part. Time for some coffee


Bookmarks

Posting Permissions

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