Script Help

admin

Administrator
Staff member
I am having trouble with this script, can y'all help me out here?

Here's the script:
<script langauge="javascript">
<!-- Hide
function grandtotal()
{
var reg=document.form1.RegType.options[document.form1.RegType.selectedIndex].value;
var tbl=document.form1.DTables.options[document.form1.DTables.selectedIndex].value;
var ttl=document.form1.Total;
if (tbl=="null" && reg=="null")
{ttl.value="0"};
else if (tbl == "null" && reg=="0")
{ttl.value="0"};
else if (tbl == "null" && reg=="80")
{ttl.value="80"};
else if (tbl == "null" && reg=="95")
{ttl.value="95"};
else if (tbl == "0" && reg=="null")
{ttl.value="0"};
else if (tbl == "0" && reg=="80")
{ttl.value="80"};
else if (tbl == "0" && reg=="95")
{ttl.value="95"};
else if (tbl == "100" reg=="null")
{ttl.value="100"};
else if (tbl == "100" && reg=="80")
{ttl.value="180"};
else if (tbl == "100" && reg=="95")
{ttl.value="195"};
else if (tbl=="150" && reg=="null")
{ttl.value="150"};
else if (tbl == "150" && reg=="80")
{ttl.value="230"};
else if (tbl == "150" && reg=="95")
{ttl.value="245"};
}
// End Hiding -->
</script>

And here are the relevent form items within the page:
<select name="RegType" onChange="grandtotal()">
<option value=http://www.webdeveloper.com/forum/archive/index.php/"null" selected>-- SELECT --</option>
<option value="95">Regular ($95)</option>
<option value="80">Early ($80)</option>
</select>

<SELECT name="DTables" onChange="grandtotal()">
<option value="null" selected>- SELECT -</option>
<option value="0">No</option>
<option value="150">Yes (for profit $150)</option>
<option value="100">Yes (nonprofit $100)</option>
</SELECT>

<INPUT type"text" size="10" name="Total">

Ok, thanks in advance...
 
Back
Top