[jQuery] multiple select boxes with the same name submiting via ajax
hi
i hope somone can help
i have a couple of records which all have (the idea anyways) have
select boxes. when a user changes the select box it submits those
changes and the record ID to another page using ajax to update the
database. so far i have
$(document).ready(function(){
$("#priority").change(function() {
jQuery.ajax({
data: "prio=" + $("#priority").val() + "&ID=1",
url: "do_priority.asp",
timeout: 2000,
error: function() {
console.log("Failed to submit");
},
success: function(r) {
$("#priority").removeAttr("disabled");
}
});
$("#priority").attr("disabled", "disabled");
});
});
it works like a charm with 1 record... as soon as there are more
records it fails. i presume this is cause its finding multiple '$
("#priority")' select boxes in the page?
the above code when you change the value of a select box it disables
the box till ajax says that it "worked" then re enables it again.
regards
william