Hello,
Based on a few parameters, I need to make an auto-quoting system for my company.
I have the basic HTML and jscript written so the user can drop down through a few products and the appropriate questions will be displayed… Now I just need to actually calculate something!
Here’s what I’m trying to do for each drop down:
Then, once these numbers are calculated, I would simply multiply the number of lights * the price so when the user hits “instant quote” it displays that calculation.
Is this something I would code in PHP?
<!DOCTYPE html>
<html>
<head>
<title>blank</title>
<meta charset=”UTF-8″>
</head>
<body>
<style>
.hide{
display:none;
}
</style>
<select id=”select” onChange=”handleSelection(value)”>
<option selected>Please select a product: </option>
<option value=”feeder”>Feeder Light </option>
<option value=”control”>Control Pan Light </option>
<option value=”layer”>Layer Light </option>
</select>
<div class=”hide” id=”feeder”>
Length of house:<input type=”text” name=”lengthofhouse” value=””></input><br />
Number of feed lines:<input type=”text” name=”numberoflines” value=””></input><br />
<button type=”button”>Instant Quote</button>
</div>
<div class=”hide” id=”control”>
Number of control pans:<input type=”text”></input><br />
<button type=”button”>Instant Quote</button>
</div>
<div class=”hide” id=”layer”>
How many levels to a row:<input type=”text”</input><br />
How many rows of cages:<input type=”text”</input><br />
Length of each row:<input type=”text”</input><br />
<button type=”button”>Instant Quote</button>
</div>
<script type=”text/javascript”>
function handleSelection(choice) {
//document.getElementById(‘select’).disabled=true;
if(choice==’feeder’)
{
document.getElementById(choice).style.display=”block”;
document.getElementById(‘control’).style.display=”none”;
document.getElementById(‘layer’).style.display=”none”;
}
if(choice==’control’)
{
document.getElementById(choice).style.display=”block”;
document.getElementById(‘feeder’).style.display=”none”;
document.getElementById(‘layer’).style.display=”none”;
}
if(choice==’layer’)
{
document.getElementById(choice).style.display=”block”;
document.getElementById(‘feeder’).style.display=”none”;
document.getElementById(‘control’).style.display=”none”;
}
}
</script>
</body>
</html>