Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form action="request.php" method="POST" id="frmLogin">
- <input type="text" id="edtLogin" />
- <br />
- <input type="password" id="edtPassword" />
- <br />
- <input type="submit" value="Login" id="btnLogin" />
- </form>
- <script type="text/javascript">
- $(document).ready(function()
- {
- $("#frmLogin").submit(function(e)
- {
- // Sitais ir lai nesubmitojas forma, kad nospiez us pogas
- e.preventDefault();
- // Sutam POST
- $.post("request.php",
- {
- login : $("edtLogin").val(),
- password : $("edtPassword").val()
- },
- function(postBack)
- {
- // postBack = Hello from request.php!
- alert(postBack);
- }
- .error(function()
- {
- // Kaut kas nesanaca
- alert("Error...");
- })
- );
- });
- });
- </script>
Add Comment
Please, Sign In to add comment