javascript - Getting tax price to calculate before submitting a form -
i'm trying tax value in checkout page calculate once state field selected. want without having submit form want display tax rate on page before order processed. i sure have ajax , have used ajax limited amount of times. know send request ajax php page , ajax pulls field need. need pull is, if ohio selected need pull value of 1.065. if other state pulled need value of 1. i have state variables listed in array format because using options state dropdown.. $taxvalue['ohio'] = "ohio"; $taxvalue['virginia'] = "virginia"; etc then tried if isset statement when ohio selected pull $taxed_state value of 1.065. else else untaxed_state. $taxed_state = 1.065; $untaxed_state = 1; if(isset($taxvalue['ohio'])){ $taxed_state; } else { $untaxed_state; } this how trying configure tax rate know work once can state set before form submitted. $base_price = 0; foreach($_session['shopp...