2
Well I’m assembling the code in jquery that will send the form, it is working. However I have some questions and I do not know how to solve.
1º - To avoid that I have to do a very repetitive javascript I wanted to know how to put the link in the 'action' tag of the 'form' and make the jquery capture the Link and put it in the 'url: "fone2.php",'.
This would make me use the same code for all forms.
2º - I need to capture the message from the file that receives the form and put it in ' Alert("sdfsdf");'.
Can someone help me with these changes.
< script type = "text/javascript" >
jQuery(document).ready(function() {
jQuery('#ajax_form').submit(function() {
var dados = jQuery(this).serialize();
jQuery.ajax({
type: "POST",
url: "fone2.php",
data: dados,
success: function() {
alert("sdfsdf");
}
});
return false;
});
}); <
/script>
< script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"> </script>
<form method="post" action="" id="ajax_form">
<input type="text" name="nome" value="" />
<input type="submit" name="enviar" value="Enviar" />
</form>
vlw was just that, thank you very much
– Hugo Borges