Here's what I ended up doing. Instead of providing a quick and uninformed official quote I'm providing an estimator. I made this using java and html. The actual math part of it is commented.
First off is the code you'll drop in to the HTML of your site, this goes where you want the actual calc to show up.
Code:
<form name="autoSumForm">
<p>Width (inches)</p><input class="right" type=text name="firstBox" value="" onFocus="startCalc();" onBlur="stopCalc();">
<p>Height (inches)</p><input class="right" type=text name="secondBox" value="" onFocus="startCalc();" onBlur="stopCalc();">
<p>Each Piece ($)</p><input class="right" readonly="readonly" type=text name="thirdBox">
<p>Quantity</p><input class="right" type=text name="fourthBox" value="1" onFocus="startCalc();" onBlur="stopCalc();">
<p>Total ($)</p><input class="right" readonly="readonly" type=text name="fifthBox">
</form>
This needs to go in your header (between the <head> tags </head>)
Code:
<script src="js/autoSum.js" type="text/javascript"></script>
Now you need to create the autoSum.js file. The path above needs to lead to where the file autoSum.js is. I store my javascript files in a folder called "js".
Code:
function startCalc(){
*interval = setInterval("calc()",1);
}
function calc(){
*one = document.autoSumForm.firstBox.value; /* this is the width box */
*two = document.autoSumForm.secondBox.value; /* this is the height box */
*num = (one * two) * (.07); /* this is where the width and height are multiplied, the .07 is the cost per square inch */
*document.autoSumForm.thirdBox.value = num.toFixed(2); /* this displays the total per piece, with the number only allowed to go to two decimal places */
*quantity = document.autoSumForm.fourthBox.value; /* just finding out how many they want */
*total = (quantity * document.autoSumForm.thirdBox.value); /* quantity multiplied by the price per piece */
*document.autoSumForm.fifthBox.value = total.toFixed(2); /* now we get to display the grand total limited to two decimal places */
}
function stopCalc(){
*clearInterval(interval);
}
Here's what the code looks like as given above RTA vinyl estimate