This js script select the value of inputfield with name: id_add_to_cart and pass to ParseProductId that parse the value:
$("input[id='add-extra']").live("click",function () {
var product_id = $("input[name='id_add_to_cart']").value;
parseProductId(product_id);
return false;
});
The parsed value is undefined for this HTML:
<form action="" method="POST">';
<input type="hidden" name="id_add_to_cart" value="100" />
<input type="submit" id="add-extra" value="Add" />';
</form>
What am I missing?
change
.valueto.val().Demo: http://jsbin.com/egiwor/2