1
I want to send without refreshing my page and using on change I’m using the code below
Form:
<form action="" id="ajax_form" method="post" >
<input type="text" name="resultado1" size="5" onChange="envia()">
</form>
Sending Script
jQuery('#ajax_form')(function envia() {
var dados = jQuery(this).serialize();
jQuery.ajax({
type: "POST",
url: "resultados.php",
data: dados,
success: function(data) {
alert(data);
}
});
return false;
});
Hello Matheus, welcome! Want to send the data when which/which inputs change(m)? Do you have a button that sends the form?
– Sergio
I send it without the use of the button, with the onChange command for every time the value is changed it send, so it is used Submit(). he refresh the page, so I called a function to send, I tried using javascript and on change but I could not set the code
– Matheus Rocha
Yes, if you use
submit()
it refreshes the page. You can make a jsFiddle to be clearer as your code is?– Sergio
I edited the code in the publication, and so it is at the moment
– Matheus Rocha
This code is a little strange... there’s nothing missing here:
'#ajax_form')(function
?– Sergio
it is so , and I do not use much jscript so I do not know if there is something wrong
– Matheus Rocha