Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug? with jquery #498

Open
fanzila opened this issue Feb 20, 2015 · 0 comments
Open

Bug? with jquery #498

fanzila opened this issue Feb 20, 2015 · 0 comments

Comments

@fanzila
Copy link

fanzila commented Feb 20, 2015

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant