code_junkie

<select> ajax calls

Nov 13th, 2011
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. $("#project select").change(function(){ // use one selector for all 3 selects
  2. $.post("someurl.php",{
  3. // data to send
  4. completed: $("select#completed").val(),
  5. hours: $("select#hours").val(),
  6. who: $("select#who").val()
  7. }, function(data) {
  8. // do callback stuff with the server response 'data' here
  9. });
  10. });
  11.  
  12. $.post("updater.php", { completed: variableWithCompletedFromSelect } );
Add Comment
Please, Sign In to add comment