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()}         });     }); }); 

demo


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -