I’m new to javascipt and am having some trouble. What i’m trying to do it update the price on a page when option is selected from a drop down menu. The selection in the drop down menu comes from a table in the database.
I’m pretty sure that i’m missing something in regards to way in which getElementById should be used.
This is the code i’m using.
[code=php]function changeText(whichText, changeShipping) {
var total_ship = 15.99;
if (changeShipping.value == “<? echo $ship_op_selection; ?>”) {
document.getElementById(whichText).innerText = total_ship;
document.checkout.total_ship.value = total_ship;
}
}
When any of the options in the drop down menu is selected the text doesn’t update.
If you need more info let me know.
Thanks in advance