Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
- <script>
- function sendData(login, pass) {
- $.ajax({
- url: "pagina.php?"+$("form").serialize(),
- success: function(data) {
- receiveData(data);
- }
- });
- return true;
- }
- function receiveData(resposta) {
- alert(resposta);
- document.getElementById("user").value = '';// limpa o campo
- document.getElementById("pass").value = '';// limpa o campo
- document.formLogin.usuario.focus();// seta o focus
- return true;
- }
- </script>
- <form action="javascript:sendData();" method="post" name="formLogin" enctype="multipart/form-data">
- <span>User:<br/></span>
- <input type="text" id="user" name="user"/>
- <br/><!-- space -->
- <span>Pass:<br/></span>
- <input type="password" id="pass" name="pass"/>
- <br/><!-- space -->
- <input type="submit" name="enter" value="Enviar"/>
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement