Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript">
- $(function() {
- $('#btnRegister').click(function () {
- var name = $('#inputFname').val();
- var family = $('#inputLname').val();
- var username = $('#inputUname').val();
- var password = $('#inputPassword').val();
- var mobile = $('#inputMobile').val();
- var address = $('#inputEmail').val();
- if (name !== '' && family !== '') {
- $.ajax({
- type: "POST",
- contentType: "application/json; charset=utf-8",
- url: "Registeration.aspx.cs/InsertUser",
- data: "{'FirstName':'" + name + "' , 'LastName' : '" + family + "' , 'UserName' :'" + username + "' , 'Password':'" + password + "', 'Mobile': '" + mobile + "','Address': '" + address + "'}",
- dataType: "json",
- success: function(data) {
- $('#inputFname').value('a');
- $('#inputLname').value('a');
- $('#inputUname').value('a');
- $('#inputPassword').value('a');
- $('#inputMobile').value('a');
- $('#inputEmail').value('a');
- alert("Registeration Complete");
- },
- error: function(result) {
- alert("Registeration Failed!");
- }
- });
- } else {
- alert("Please fill all fields!");
- return false;
- }
- });
- })
- </script>
Add Comment
Please, Sign In to add comment