javascript - dropbox onchange with jquery-ui -



javascript - dropbox onchange with jquery-ui -

i'm trying onselect , javascript function doesn't work. works when take away jquery-ui script, ugly forms.

<select id="productkleur" style="width: 200px;" onchange="productkleurchange()" data-theme="c" data-native-menu="true"> <option value="1" id="1">zwart</option> <option value="2" id="2">rood</option> <option value="3" id="3">groen</option> <option value="4" id="4">paars</option> <option value="5" id="5">blauw</option> <option value="6" id="6">geel</option> </select>

i tried this:

$("#productkleur").combobox({ select: function (event, ui) { alert("the select event has fired!"); var productid = $("#productid").val(); var kleur = $("#productkleur").val(); var voorraad = $("#productcolourstock").val(); var = "add"; console.log("change "+kleur+" "+productid+" stock "+voorraad); } } );

i tried this

function productkleurchange() { var productid = $("#productid").val(); var kleur = $("#productkleur").val(); var voorraad = $("#productcolourstock").val(); var = "add"; console.log("change "+kleur+" "+productid+" stock "+voorraad); };

the lastly 1 works fine when remove jquery-ui, when don't nil happens.

anyone knows why or how prepare this?

try working code using jquery

$( "#productkleur" ).change(function() { var productid = $("#productid").val(); var kleur = $("#productkleur").val(); var voorraad = $("#productcolourstock").val(); var = "add"; console.log("change "+kleur+" "+productid+" stock "+voorraad); });

remove onchange="productkleurchange()" html before trying above code.

javascript jquery jquery-ui

Comments

Popular posts from this blog

java Multi query from Mysql using netbeans -

c# - DotNetZip fails with "stream does not support seek operations" -

c++ - StartServiceCtrlDispatcher don't can access 1063 error -