I'm working with MachForm and have this hidden field that I've added:
<input type="hidden" name="element_273_price" value="">
I've integrated an ajax drop down menu that allows for an onclick event to be fired. I'd like the hidden field above to have a value inputted after the onclick event (onclick would tell the hidden field what the item was and price for that item) so that I can then pass it along through the rest of the JavaScript for the updating of the price on screen.
Here's my code for calculating a text box:
$('#main_body li[data-pricefield="text"]').delegate('input.text','keyup mouseout change', function(e) {
var temp = $(this).attr("id").split('_');
var element_id = temp[1];
var ordered = (document.getElementById("element_" + element_id).value);
var price = $(this).data('pricedef');
var price_value = price * ordered;
price_value = parseFloat(price_value);
if(isNaN(price_value)){
price_value = 0;
}
$("#li_" + element_id).data("pricevalue",price_value);
calculate_total_payment();
});