mardi 30 décembre 2014

Jquery - Select Manipulating with Checkboxes

I got a problem with my Script. Its working great with a "normal" name for the Selection, but I use a Shop CMS which names the Selection like this: "ItemOrderParams[0][g19]" and the script isnt working anymore with that name. Can somebody solve this problem? I have no Idea how to fix it.



$("input[id=steckdose]").on("change", function(){
if($(this).is(":not(:checked)"))
$(function() {
$('[name=ItemOrderParams[0][g19]]').val( '3' );
})
});
$("input[id=steckdose]").on("change", function(){
if($(this).is(":checked"))
$(function() {
$('[name=ItemOrderParams[0][g19]]').val( '2' );
})
});

<select name="ItemOrderParams[0][g19]">
<option value="1">Red</option>
<option value="2" selected="1">Green</option>
<option value="3">Blue</option>
</select>




Aucun commentaire:

Enregistrer un commentaire