Here is a snip of my form i am using. I am using javascript to set the value of the dollars and cents to the 2 and 00 but it does not work. Can anyone correct this? Thank you
<select class="element select medium" id="element_8" name="element_8" onChange="update_txt()">
<option value="" selected="selected"></option>
<option value="First option" >First option</option>
<option value="Second option" >Second option</option>
<option value="Third option" >Third option</option>
</select>
<input id="subtotal" name="subtotal" class="element text currency" size="10" value="" type="text" /> .
<label for="subtotal">Dollars</label>
<input id="subtotalcents" name="subtotalcents" class="element text" size="2" maxlength="2" value="" type="text" />
<label for="subtotalcents">Cents</label>
<script>function update_txt(){
price = document.getElementById('element_8').value;
document.getElementById('element_7').value = price;
document.getElementById('element_7').focus();
document.getElementbyId('subtotal').value ='2';
document.getElementbyId('subtotalcents').value ='00';
}
</script>
Aucun commentaire:
Enregistrer un commentaire