الطول
تقوم هذه السكريبت بحساب نسبة توازن طولك مع وزنك لمعرفة إذا كنت تتمتع موزن يتناسب مع طولك
يزن نت
<body> </body>انسخ الكود وألصقه بين الواصفتين
<h2 align="center"><script language="JavaScript"> <!-- hide from old browsers function ClearForm (form) { form.weight.value=""; form.waist.value=""; form.bodyfat.value=""; } function VerifyForm(form) { // Holds whether or not the form is correct var Correct = true; // Check for missing fields if (form.weight.value == null || form.weight.value.length == 0 || form.waist.value == null || form.waist.value.length == 0) { alert ("\nPlease fill in all of the form elements"); Correct = false; } // Check that only numbers are in the weight and waist fields else { // Holds the floats representing the weight and waist var TestWeight; var TestWaist; // Parse the weight and waist values and put in the variables TestWeight = parseFloat(form.weight.value); TestWaist = parseFloat(form.waist.value); // Check to see that TestWeight is a number if (isNaN (TestWeight)) { alert("\nMake sure to enter the weight\nas a number."); Correct = false; form.weight.value=""; } // Check to see that TestWaist is a number if (isNaN (TestWaist)) { alert("\nMake sure to enter the waist size\nas a number."); Correct = false; form.waist.value=""; } // Check that the TestWeight is greater than 0 if (TestWeight <= 0) { alert("\nCome on. Enter a real weight."); Correct = false; form.weight.value=""; } // Check that the TestWaist is greater than 0 if (TestWaist <= 0) { alert("\nCome on. Enter a real waist size."); Correct = false; form.waist.value=""; } } // If the inputs are correct, calculate the bodyfat percent if (Correct) { // Holds the bodyfat number and percent var BF; var BFPercent; // Make the male calculations if (form.gender[0].checked) { BF = -98.42 + 4.15*TestWaist - .082*TestWeight; } // Make the female calculations else { BF = -76.76 + (4.15*TestWaist) - (.082*TestWeight); } // Calculate the bodyfat percentage BFPercent = BF / TestWeight; BFPercent = BFPercent * 100; BFPercent = Math.round(BFPercent); // Send this number to the screen form.bodyfat.value = BFPercent + "%"; } } // finish hiding from old browsers --> </script></h2> <form method="post" name="bodyfat"> <div align="center"><center><table border="2" cellpadding="5"> <font color="#FFFF00"><TBODY></font> <tr> <td><font color="#FFFF00" face="Tahoma">ذكر ولا أنثى؟<br> <input type="radio" checked name="gender" value="MalePick" align="left"> ذكر<br> <input type="radio" name="gender" value="FemPick" align="left"> أنثى<br> </font></td> <td valign="top"><font color="#FFFF00" face="Tahoma">كم وزنك؟(lbs.)<br> <input type="text" size="8" name="weight"><br> <br> كم طولك بالإنش؟<br> <input type="text" size="8" name="waist"> </font></td> </tr> <tr> <td colspan="2"><font color="#FFFF00"><input type="button" value="أمسح" onclick="ClearForm(this.form)"> <input type="button" value="أحسب النتيجه" onclick="VerifyForm(this.form)"></font></td> </tr> <tr> <td colspan="2"><p align="center"><a href="http://www.khayma.com/yazan" target="_blank"><font color="#FFFF00">يزن نت</font></a><font color="#FFFF00"> <font تناسق وزنك مع طولك هي </FONT> <input type="text" size="10" name="bodyfat"> </font></font></p> </td> </tr> <font color="#FFFF00"></TBODY></font> </table> </center></div> </form> <font color="#22165A"><!-- END OF SCRIPT --></font> <p> </p>
مع تمنياتي بالتوفيق ولا تتردد في حالة الاستفسار بالكتابة على هذا العنوان
service_ynet@yahoo.com
رجـوع