Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
- <script type="text/javascript">
- function _submit(){
- $("p").html("YOU ARE HERE 1");
- var username = $('input#x').val();
- var password = $('input#y').val();
- var mydata = $('.myform').serialize();
- if (username != "" && password != "") {
- $.ajax({
- data: mydata,
- dataType: 'text',
- type: 'POST',
- url: 's11.php',
- success: function(responseText) {
- $('#display').html(responseText);
- },
- failure: function() {
- alert("Failed");
- },
- error: function() {
- $('#display').html("Error");
- }
- });
- }
- }
- </script>
- <body>
- <form class="myform">
- <input type="text" name="username" placeholder="Username" class="a" id="x" required></input>
- <input type="password" name="password" placeholder="Password" class="a" id="y" required></input>
- </form>
- <button class="b" id="n" onclick="_submit()">Submit</button>
- <div id="display"></div>
- <p></p>
- </body>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement