Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form method="GET" action="/popup-teste" id="ID_DO_FORMULARIO">
- <button type="submit>OK!</button>
- <input name="teste" id="input1">
- </form>
- <script language="JavaScript">
- $(document).ready(function() {
- $('#ID_DO_FORMULARIO').submit(function() { // pega o evento do form submit
- $.ajax({ // create an AJAX call...
- data: $(this).serialize(), // pega os dados do form
- type: $(this).attr('method'), // GET ou POST
- url: $(this).attr('action'), // pega a url no form action
- success: function(response) { // quando bem sucedido
- $('#DIV_PARA_ATUALIZAR').html(response); // atualiza o DIV
- }
- });
- return false;
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement