Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Enviar formulario por ajax

//

<form id="formularioaenviar" action="/destino.php" method="post">....</form>

<script type="text/javascript">
$('#formularioaenviar').submit(function (ev) {
  $.ajax({
    type: $('#formularioaenviar').attr('method'), 
    url: $('#formularioaenviar').attr('action'),
    data: $('#formularioaenviar').serialize(),
    success: function (data) { alert('Datos enviados !!!'); } 
  });
  ev.preventDefault();
});
</script>
 
PREVIOUS NEXT
Tagged: #Enviar #formulario #por #ajax
ADD COMMENT
Topic
Name
9+9 =