Next, I have a form that will be sent with AJAX, however the URL will vary according to the ID, eg:
site.com/ajax/remove/100 <- ID
site.com/ajax/remove/200 <- ID
This value of the ID is in a hidden field of the form, how can I get this value and move to ajax? example code:
jQuery(document).ready(function() {
jQuery('#send_request').submit(function() {
var dados = jQuery(this).serialize();
//var id =
jQuery.ajax({
url : 'site.com/'+id,
dataType : 'JSON',
type : "POST",
data : dados,
success : function(response) {
//alert(response.message);
if (response.success == 1) {
//tudo ok
} else {
//deu ruim,zé
}
}
});
return false;
});
});