/    Sign up×
Community /Pin to ProfileBookmark

Creating an auto-sales-quote form

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:

# of Feeder Lights = (Length of house * # of feed lines) / 7.5


# of Control Pans = # of Control Pans


# of Layer Lights = (levels per row * rows of cages) * length of each row

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>

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @sleepytimemike spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...