html - jQuery Select array not working -
html code:
<select name="code[]"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> <select name="code[]"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select> <select name="code[]"> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> </select>
jquery code:
var codes = $("input[name='code[]']").serializearray(); alert(codes);
alert empty why happening selected value in select box. still, empty can please me. how can resolve error?
the selector trying find inputs.. should change select.
var codes = $("select[name='code[]']").serializearray();
Comments
Post a Comment