|
<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?
|