I received this form from Cheech on this forum and it works great. I was wondering how would you add a button that when checked would add an 8.25% sales tax to the total. I want to add this option for customers that live in the same state I am in. Any help would be greatly appreciated.
Regards,
Todd
Texas
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script language="javascript">
function sumup(){
if (document.forms.form1.painting.value == "0"){
paintval=0;
}
if (document.forms.form1.painting.value == "painting1"){
paintval=100;
}
if (document.forms.form1.painting.value == "painting2"){
paintval=400;
}
if (document.forms.form1.painting.value == "painting3"){
paintval=600;
}
quantval = document.forms.form1.quantity.value;
mountval = document.forms.form1.mounting.value;
totalval = (paintval*quantval) + (mountval*quantval);
document.forms.form1.total.value = totalval;
}
</script>
</head>
<body>
<form name="form1" method="post" action="">
<p>
<select name="painting" id="painting" onChange="return sumup();">
<option value="0" selected>** Please select **</option>
<option value="painting1">Painting 1 - £100</option>
<option value="painting2">Painting 2 - £400</option>
<option value="painting3">Painting 3 - £600</option>
</select>
Which Painting<br>
<input name="quantity" type="text" id="quantity" value="0" size="5" onChange="return sumup()">
How many?<br>
<select name="mounting" id="mounting" onChange="return sumup()">
<option value="0">** Pease Select **</option>
<option value="150">Canvas - £150</option>
<option value="250">Stretched - £250</option>
<option value="350">Framed & Stretched - £350</option>
</select>
Mounting Options?
</p>
<p>
<input name="total" type="text" id="total" value="0" size="8" readonly>
Total Cost (Quantity * (Painting choice + Mounting cost)) </p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
</body>
</html>
Regards,
Todd
Texas
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
<script language="javascript">
function sumup(){
if (document.forms.form1.painting.value == "0"){
paintval=0;
}
if (document.forms.form1.painting.value == "painting1"){
paintval=100;
}
if (document.forms.form1.painting.value == "painting2"){
paintval=400;
}
if (document.forms.form1.painting.value == "painting3"){
paintval=600;
}
quantval = document.forms.form1.quantity.value;
mountval = document.forms.form1.mounting.value;
totalval = (paintval*quantval) + (mountval*quantval);
document.forms.form1.total.value = totalval;
}
</script>
</head>
<body>
<form name="form1" method="post" action="">
<p>
<select name="painting" id="painting" onChange="return sumup();">
<option value="0" selected>** Please select **</option>
<option value="painting1">Painting 1 - £100</option>
<option value="painting2">Painting 2 - £400</option>
<option value="painting3">Painting 3 - £600</option>
</select>
Which Painting<br>
<input name="quantity" type="text" id="quantity" value="0" size="5" onChange="return sumup()">
How many?<br>
<select name="mounting" id="mounting" onChange="return sumup()">
<option value="0">** Pease Select **</option>
<option value="150">Canvas - £150</option>
<option value="250">Stretched - £250</option>
<option value="350">Framed & Stretched - £350</option>
</select>
Mounting Options?
</p>
<p>
<input name="total" type="text" id="total" value="0" size="8" readonly>
Total Cost (Quantity * (Painting choice + Mounting cost)) </p>
<p>
<input type="submit" name="Submit" value="Submit">
</p>
</form>
</body>
</html>