Guest User

Untitled

a guest
Feb 6th, 2019
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.59 KB | None | 0 0
  1. <script type="text/javascript">
  2.  
  3. $(function() {
  4. $('#btnRegister').click(function () {
  5. var name = $('#inputFname').val();
  6. var family = $('#inputLname').val();
  7. var username = $('#inputUname').val();
  8. var password = $('#inputPassword').val();
  9. var mobile = $('#inputMobile').val();
  10. var address = $('#inputEmail').val();
  11. if (name !== '' && family !== '') {
  12. $.ajax({
  13. type: "POST",
  14. contentType: "application/json; charset=utf-8",
  15. url: "Registeration.aspx.cs/InsertUser",
  16. data: "{'FirstName':'" + name + "' , 'LastName' : '" + family + "' , 'UserName' :'" + username + "' , 'Password':'" + password + "', 'Mobile': '" + mobile + "','Address': '" + address + "'}",
  17. dataType: "json",
  18. success: function(data) {
  19. $('#inputFname').value('a');
  20. $('#inputLname').value('a');
  21. $('#inputUname').value('a');
  22. $('#inputPassword').value('a');
  23. $('#inputMobile').value('a');
  24. $('#inputEmail').value('a');
  25. alert("Registeration Complete");
  26.  
  27. },
  28. error: function(result) {
  29. alert("Registeration Failed!");
  30. }
  31. });
  32. } else {
  33. alert("Please fill all fields!");
  34. return false;
  35. }
  36. });
  37. })
  38.  
  39. </script>
Add Comment
Please, Sign In to add comment