jquery - Get value of a select element with ajax -
i'm trying value of select element, returning array()
this html:
<select name="data[attorney][empresa]" id="attorneyempresa"> <option value="">selecione</option> <option value="3">sotreq</option> </select>
and jquery:
$(document).ready(function() { $("#attorneyempresa").change(function(){ $.ajax({ type: 'post', data: $('#attorneyempresa').val() }); }); });
what's wrong?
try this
$(document).ready(function() { $("#attorneyempresa").change(function(){ $.ajax({ type: 'post', data: {keyname:$('#attorneyempresa option:selected').val()} }); }); });
Comments
Post a Comment