Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9273937
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T16:13:58+00:00 2026-06-18T16:13:58+00:00

The alert window gives me the message NaN what is wrong? Thanx for all

  • 0

The alert window gives me the message NaN what is wrong?
Thanx for all the help

var weight = parseFloat(document.BMI.weight.value)
var height = parseFloat(document.BMI.height.value)

function calcBMI() {
var answer = weight * 703 / (height*height)
return answer;
  }
    </script>


 <form action="" name="BMI">
<input type="text" name="weight" />
<input type="text" name="height" />
<input type="submit" onclick="alert(calcBMI())" />
</form>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T16:13:59+00:00Added an answer on June 18, 2026 at 4:13 pm
    <script type="text/javascript">
    function calcBMI() {
    var weight = parseFloat(document.BMI.weight.value)
    var height = parseFloat(document.BMI.height.value)
    var answer = weight * 703 / (height*height)
    return answer;
      }
        </script>
    
    
     <form action="" name="BMI">
    <input type="text" name="weight" />
    <input type="text" name="height" />
    <input type="submit" onclick="alert(calcBMI())" />
    </form>
    

    Hopefully it works now 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

var loc_name = document.forms['create_<?php echo(htmlspecialchars($window_ID)); ?>'].elements['location_name']; alert(loc_name); This just gives me the message 'undefined'
var doc = w.document; doc.open('application/CSV','replace'); doc.charset = utf-8; doc.write(all,hello); doc.close(); if(doc.execCommand(SaveAs,null,file.csv)) { window.alert(saved );
Consider a basic addEventListener as window.onload=function(){ document.getElementById(alert) .addEventListener('click', function(){ alert(OK); }, false); } where
function getCode() { if (window.location.href.indexOf(?discount=)) { var url = (document.URL); var id = url.substring(url.lastIndexOf('=')
I want to present an alert window with no button on it, that means
I have few questions, I want to show the alert window on my Update
If I put a window.alert on a webworker client, then the background worker stops
I have this script loaded on a page: (function() { window.alert('bookmarklet started'); function AjaxSuccess(data,
I just want my GM script to do a window.alert(foo) where foo is equal
When i resize my window then alert width and height then again resize my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.