Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- $("#register_form").submit(function() {
- $('#register_result').html('<img src="path to file" /> Registering...');
- $.ajax({
- type: "POST",
- url: "path to file",
- data: {
- email: $('#email').val(),
- user: $('#user').val(),
- pass: $('#pass').val(),
- pass2: $('#pass2').val()
- },
- success: function(result) {
- if(result == 1){
- $('#register_result').html('Username taken!');
- } else if(result == 0) {
- $('#register_result').html('Error in the form (make sure nothing was left blank and passwords match)');
- } else if(result == 2) {
- $('#register_result').html('Incorrect style of email, please re-check that its correct!');
- } else if(result == 3) {
- $('#register_result').html('Success! Account created');
- } else {
- $('#register_result').html('Something went wrong, we will get our crack team of nerds to help fix your problem!');
- }
- },
- error: function(jqXHR, textStatus, errorThrown) {
- alert(JSON.stringify(jqXHR));
- }
- });
- return false;
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement