I'm trying to send a form through a function. Follow the structure.
form with id: last name
input with id: nickname
event keyup no input.
onkeyup="$(this).check()"
Javascript
(function($) {
$.fn.check = function() {
alert('a');
$('#apelido').delay(200).submit();
};
})(jQuery);
$("#apelido").submit(function (event) {
alert('s');
event.preventDefault();
$.ajax({
type: "get",
url: '<?php echo base_url();?>index/check',
data: {id: '425', inputv : 'adm', nameinput: 'apelido'},
success: function (response) {
alert(response);
}
});
});
The first alert is called, the second is not ... I no longer know what to do. Any help is welcome.