Welcome to Dream.In.Code
Getting Help is Easy!

Join 118,479 Programmers for FREE! Ask your question and get quick answers from experts. There are 971 online right now! We've got more than 500 tutorials and 2,000 snippets. Join and find out why Dream.In.Code is the #1 programming help community on the internet! Registration is fast and FREE... Join Now!



how to calculate BMI using data input

 
Reply to this topicStart new topic

how to calculate BMI using data input

penyupatta
post 6 Jan, 2008 - 02:06 AM
Post #1


New D.I.C Head

*
Joined: 5 Jan, 2008
Posts: 1

<cfparam name="form.height" default="">
<cfparam name="form.weight" default="">
<cfparam name="variables.bmi" default="">

<html>
<head>

<script = javascript>

function jumpTo(form)
{
form.action = "<cfoutput>#cgi.script_name#?#cgi.query_string#</cfoutput>";
form.submit();
}

</script>

<cfif isdefined("session.option")>
<cfset session.option.weight_="">
<cfset session.option.height_="">
</cfif>

<cfset session.option.weight_ = form.weight>
<cfset session.option.height_ = form.height>
<cfset weight_ = weight>
<cfset height_ = height>
<cfset bmi = ((weight_)/(height_*height))>

<link href="style/font.css" rel="stylesheet" type="text/css">

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head>
<body bgcolor="#CCCCCC">
<cfform name="biodata" action="RegisterBiodataProses.cfm">
<table width="646" height="421" align = "center" bgcolor="#5E76CC" class="noTable">
<tr>
<td width="102"> </td>
<td valign="middle" class="style3">Berat</td>
<td><div align="center">:</div></td>
<td colspan="2"><cfinput name="weight" type="text" size="7" value="#session.option.weight_#">
<span class="style3">kg</span></td>
</tr>
<tr>
<td width="102"> </td>
<td valign="middle" class="style3">Tinggi</td>
<td><div align="center">:</div></td>
<td colspan="2"><cfinput name="height" type="text" size="7" maxlength ="3" value="#session.option.height_#">
<span class="style3">m</span></td>
</tr>
<tr>
<td width="102"> </td>
<td valign="middle" class="style3">BMI</td>
<td><div align="center">:</div></td>
<td colspan="2"><cfinput type="text" name="bmi" value="#variables.bmi#" readonly="yes"></td>
</tr>

<tr>
<td width="102"> </td>
<td colspan="2" ><div align="right">
<input type="submit" name="Submit" value="Submit">
</div></td>
<td colspan="2" ><input type="reset" name="Submit2" value="Reset"></td>
</tr>
</table>

</cfform>


i want to calculate bmi(body mass index) using weight(in kg) and height(in meter) which key in by user. When user key in weight and height, result of bmi calculation will appear immediately. All this value will be insert into database. Can anybody help me?
User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 10/11/08 06:04AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month