You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When formatting a form select with jquery mobile, simplecart-js return wrong values.
I get the the name of the product AND the id instead of only the id (look into simpleCart_items datastorage var).
If I do not apply the style I get only the id. If I get the value directly from JS, it's working, I only get the id.
Live demo here : http://62.210.240.67/hank/public/Menu.html
Code :
<script>
localStorage.clear();
function test() {
var contain ='';
contain = contain + '<label for="item_drink" class="select">Drink:</label> \
<select id="item_drink" name="item_drink" class="item_drink">';
contain = contain + '<option value="9">Cola</option><option value="2">Bionade</option>';
contain = contain + '</select>';
document.getElementById("main").innerHTML = contain;
<!-- if removed, you get only the id but you loose the style -->
$('#item_drink').selectmenu();
$('#item_drink').selectmenu("refresh");
var val = $( "select.item_drink option:selected").val();
console.log(val);
}
simpleCart({
checkout: {
type: "PayPal",
email: "[email protected]"
}
});
</script>
<div class="simpleCart_shelfItem">
<div id="main"></div>
<a class="item_add ui-link" href="javascript:;"> Add to Cart </a>
</div>
The text was updated successfully, but these errors were encountered:
When formatting a form select with jquery mobile, simplecart-js return wrong values.
I get the the name of the product AND the id instead of only the id (look into simpleCart_items datastorage var).
If I do not apply the style I get only the id. If I get the value directly from JS, it's working, I only get the id.
Live demo here : http://62.210.240.67/hank/public/Menu.html
Code :
The text was updated successfully, but these errors were encountered: