JSFiddle - React, Tailwind, and code Playground
HTML
<body>
<form onsubmit="showpell_12_13(this.efc.value); return false;">
<form onsubmit="showpell_13_14(this.efc2.value); return false;">
<div align="center"><strong><em>EFC Calculator:</em></strong></p><br />
<div align="center"><input type="text" name="efc" placeholder="Enter EFC Here" value="Enter EFC here..." onblur="if(this.value == ''){ this.value = 'Enter EFC here...'; this.style.color = '#ebebeb';}" onfocus="if(this.value == 'Enter EFC here...'){ this.value = ''; this.style.color = '#000';}" style="color:#000000;" title="EFC Calculator" maxlength="5"/>
</div><br />
<!--placeholder="Enter EFC Here" serves as placeholder for all browsers. Does not work for IE9 or below, hence the included JS, which allows placeholder in IE8-->
<input type="submit" value="EFC - 12 / 13" style="margin-bottom: 10px; width: 40%;" />
<input type="submit" value="EFC - 13 / 14" style="margin-bottom: 10px; width: 40%;" /><br />
<input type="reset" value="Reset" style="margin-bottom: 10px; width: 31%;"/>
</form>
</body>
JavaScript
// Begin EFC Calculator for 2012-2013
function showpell_12_13(efc) {
var pell;
var ssg;
var estpay;
var monthpay;
if (efc == 0) {
pell = 5550;
ssg = 0;
estpay = -483;
monthpay = 0;
}
else if (efc <= 100) {
pell = 5500;
ssg = 0;
estpay = -433;
monthpay = 0;
}
else if (efc < 200) {
pell = 5400;
ssg = 0;
estpay = -333;
monthpay = 0;
}
else if (efc < 300) {
pell = 5300;
ssg = 0;
estpay = -233;
monthpay = 0;
}
else if (efc < 400) {
pell = 5200;
ssg = 0;
estpay = -133;
monthpay = 0;
}
else if (efc < 500) {
pell = 5100;
ssg = 0;
estpay = -33;
monthpay = 0;
}
else if (efc < 600) {
pell = 5000;
ssg = 67;
estpay = 0;
monthpay = 0;
}
else if (efc < 700) {
pell = 4900;
ssg = 167;
estpay = 0;
monthpay = 0;
}
else if (efc < 800) {
pell = 4800;
ssg = 267;
estpay = 0;
monthpay = 0;
}
else if (efc < 900) {
pell = 4700;
ssg = 367;
estpay = 0;
monthpay = 0;
}
else if (efc < 1000) {
pell = 4600;
ssg = 467;
estpay = 0;
monthpay = 0;
}
else if (efc < 1100) {
pell = 4500;
ssg = 567;
estpay = 0;
monthpay = 0;
}
else if (efc < 1200) {
pell = 4400;
ssg = 667;
estpay = 0;
monthpay = 0;
}
else if (efc < 1300) {
pell = 4300;
ssg = 767;
estpay = 0;
monthpay = 0;
}
else if (efc < 1400) {
pell = 4200;
ssg = 867;
estpay = 0;
monthpay = 0;
}
else if (efc < 1500) {
pell = 4100;
ssg = 967;
estpay = 0;
monthpay = 0;
}
else if (efc < 1600) {
pell = 4000;
ssg = 1067;
estpay = 0;
monthpay = 0;
}
else if (efc < 1700) {
pell = 3900;
ssg = 1167;
estpay = 0;
monthpay = 0;
}
else if (efc < 1800) {
pell = 3800;
ssg = 1267;
estpay = 0;
monthpay = 0;
}
else if (efc < 1900) {
pell = 3700;
ssg = 1367;
estpay = 0;
monthpay = 0;
}
else if (efc < 2000) {
pell = 3600;
ssg = 1467;
estpay = 0;
monthpay = 0;
}
else if (efc...