I am trying to retrieve data from my form when I post(submit) the data. But I have some ignorance about ajax with jquery.
Today, my code looks like this:
$(function() {
$(".apply_up").submit(function(e){
$.post("controller/ajax.php", function(data) {
alert("Data Loaded: " + data);
});
});
});
And here's my HTML:
<form name="Apply" class="apply_up" method="Post">
<input type="image" src="img/t_up.png" id="ajax" name="t_up" value="1 ">
</form>
I want to pick up value = "1"
$("#ajax").attr("value")valueit's better to useval(). Also, for code longevity, it's better to useprop().