Search
 
SCRIPT & CODE EXAMPLE
 

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>
Comment

PREVIOUS NEXT
Code Example
Javascript :: js create p element with text 
Javascript :: function inside object javascript 
Javascript :: javascript count character in string 
Javascript :: javascript default parameters 
Javascript :: falsy values javascript 
Javascript :: get element in javascript 
Javascript :: aes 256 nodejs 
Javascript :: debounce javascript 
Javascript :: Visible, non-interactive elements with click handlers must have at least one keyboard listener jsx-a11y/click-events-have-key-events 
Javascript :: flatmap javascript 
Javascript :: discord.js get the message before 
Javascript :: come andare a capo su javascript 
Javascript :: javascript Convert to Boolean Explicitly 
Javascript :: •“In React, everything is a component.” Explain 
Javascript :: add class in element on scroll 
Javascript :: discord js 
Javascript :: create react expo 
Javascript :: foreach modify array javascript 
Javascript :: spining load react component 
Javascript :: javascript splice 
Javascript :: async await class component react 
Javascript :: angular input type text character limit 
Javascript :: install specific version of npm for your project 
Javascript :: how to check if user has installed pwa 
Javascript :: use font awesome in react native 
Javascript :: atob javascript 
Javascript :: Pass Props to a Component Using default parameters in react 
Javascript :: javascript unselect radio 
Javascript :: sort method in js 
Javascript :: type svg react 
ADD CONTENT
Topic
Content
Source link
Name
5+7 =