retromad
07-08-2003, 02:28 PM
I am having difficulty getting the family size option working with this script. It is intended to calculate the % above or below the federal poverty line for use in our non-profit law firm
the math is as follows.
form.monthly.value = (form.monthly_income.value*12/(5840+(3140*(form.family_size)))*100;
I don't know alot about java so thanks in advance for any help you may provide
here is the entire thing.
<html>
<head>
<title>FPL Calculator</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function yfpl (form) {
form.yearly.value = (form.yearly_income.value/8976)*100;
}
function mfpl (form) {
form.monthly.value = (form.monthly_income.value*12/(5840+(3140*(form.family_size)))*100;
}
// End -->
</SCRIPT>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="400" border="0" height="200">
<tr>
<td colspan="2"><font face="Georgia, Times New Roman, Times, serif" size="2"><b>FPL
Calculator - either monthly or yearly income</b></font></td>
</tr>
<tr>
<td width="61">Monthly:</td>
<td rowspan="2">
<form>
<p> <font face="Georgia, Times New Roman, Times, serif"> <font size="2">
</font><font face="Georgia, Times New Roman, Times, serif"><font size="2">
<input type="text" name="monthly_income" value="Enter monthly income here" size="30">
</font></font><font size="2">
<input type="text" name="family_size" value="family size" size="10">
</font></font><font size="2">
<input type="button" value="Calculate" ONCLICK="mfpl(this.form)">
</font></p>
<p align="right"><font size="2" face="Georgia, Times New Roman, Times, serif">Their
income is
<input type="text" name="monthly">
% of FPL</font></p>
</form>
</td>
</tr>
<tr>
<td width="61"> </td>
</tr>
<tr>
<td width="61">Yearly:</td>
<td rowspan="2">
<form name="form2" method="post" action="">
<p> <font size="2"> <font face="Verdana, Arial, Helvetica, sans-serif">
<input type="text" name="yearly_income" size="30" value="Enter yearly income here">
<input type="text" name="family_size2" value="family size" size="10">
</font><font face="Georgia, Times New Roman, Times, serif"><font size="2">
<input type="button" value="Calculate" onClick="yfpl(this.form)" name="button">
</font></font></font></p>
<p align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Their
income is
<input type="text" name="yearly">
% of FPL</font></p>
</form>
</td>
</tr>
<tr>
<td width="61"> </td>
</tr>
</table>
</body>
</html>
thanks again
Jason Muma
the math is as follows.
form.monthly.value = (form.monthly_income.value*12/(5840+(3140*(form.family_size)))*100;
I don't know alot about java so thanks in advance for any help you may provide
here is the entire thing.
<html>
<head>
<title>FPL Calculator</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function yfpl (form) {
form.yearly.value = (form.yearly_income.value/8976)*100;
}
function mfpl (form) {
form.monthly.value = (form.monthly_income.value*12/(5840+(3140*(form.family_size)))*100;
}
// End -->
</SCRIPT>
</head>
<body bgcolor="#FFFFFF" text="#000000">
<table width="400" border="0" height="200">
<tr>
<td colspan="2"><font face="Georgia, Times New Roman, Times, serif" size="2"><b>FPL
Calculator - either monthly or yearly income</b></font></td>
</tr>
<tr>
<td width="61">Monthly:</td>
<td rowspan="2">
<form>
<p> <font face="Georgia, Times New Roman, Times, serif"> <font size="2">
</font><font face="Georgia, Times New Roman, Times, serif"><font size="2">
<input type="text" name="monthly_income" value="Enter monthly income here" size="30">
</font></font><font size="2">
<input type="text" name="family_size" value="family size" size="10">
</font></font><font size="2">
<input type="button" value="Calculate" ONCLICK="mfpl(this.form)">
</font></p>
<p align="right"><font size="2" face="Georgia, Times New Roman, Times, serif">Their
income is
<input type="text" name="monthly">
% of FPL</font></p>
</form>
</td>
</tr>
<tr>
<td width="61"> </td>
</tr>
<tr>
<td width="61">Yearly:</td>
<td rowspan="2">
<form name="form2" method="post" action="">
<p> <font size="2"> <font face="Verdana, Arial, Helvetica, sans-serif">
<input type="text" name="yearly_income" size="30" value="Enter yearly income here">
<input type="text" name="family_size2" value="family size" size="10">
</font><font face="Georgia, Times New Roman, Times, serif"><font size="2">
<input type="button" value="Calculate" onClick="yfpl(this.form)" name="button">
</font></font></font></p>
<p align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Their
income is
<input type="text" name="yearly">
% of FPL</font></p>
</form>
</td>
</tr>
<tr>
<td width="61"> </td>
</tr>
</table>
</body>
</html>
thanks again
Jason Muma