Answer the question
In order to leave comments, you need to log in
Why doesn't e.preventDefault() work?
Hey!
There is a drop down list on the page. I want to pull out the information from the database according to the ID with each selection of the item and issue it through alert.
My jQuery code:
$("#all-requests").on('change', function (e) {
e.preventDefault();
var pick = this.value;
$.ajax({
url:"/requests/get-request-desc",
type: "GET",
data: {id: pick},
success:function(data) {
alert(data);
}
});
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question