This is just a test site for me to mess a round on. All I am trying to do is dynamically fill the “your price” field with a number generate by a simple calculation. “number put into acres” * “1 or 2 depending on the regularity the chose”
Page can be found
[url]http://www.gdarb.com/jj/estimate.html
Javascript…
[code=html]
function autofill() {
document.estimate.price.value = “$” + document.estimate.acres.value * document.estimate.regularity.value * 10 + ” per week”;
}
HTML…
[code=html]
<script type=”text/javascript” src=”_js/estimate.js”></script>
<form id=”estimate” action=”” method=”get”>
<fieldset>
<legend>Free (Rough) Estimate</legend><br />
<label for=”acres”>Acres</label>
<input type=”text” name=”acres” id=”acres” value=”” size=”5″ maxlength=”7″ onkeyup=”autofill()” /><br />
<label for=”regularity”>Regularity of Service</label>
<select size=”1″ id=”regularity” name=”regularity” onchange=”autofill()”>
<option value=”1″>Once a week</option>
<option value=”2″>Twice a week</option>
</select><br /><br />
<label for=”price”>Your Price</label>
<input type=”text” name=”price” id=”price” value=”” size=”5″ maxlength=”20″ readonly=”readonly” /><br />
</fieldset>
</form>