-
Notifications
You must be signed in to change notification settings - Fork 0
/
vpb_script.js
62 lines (59 loc) · 2.08 KB
/
vpb_script.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/*********************************************************************
* This script has been released with the aim that it will be useful.
* Written by Vasplus Programming Blog
* Website: www.vasplus.info
* Email: [email protected]
* All Copy Rights Reserved by Vasplus Programming Blog
***********************************************************************/
//This does the users registration
function Users_Registration()
{
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
var fullnames = $("#fullnames").val();
var usernames = $("#usernames").val();
var emails = $("#emails").val();
var passs = $("#passs").val();
if(fullnames == "")
{
$("#signup_status").html('<div class="info">Please enter your fullname in the required field to proceed.</div>');
$("#fullnames").focus();
}
else if(usernames == "")
{
$("#signup_status").html('<div class="info">Please enter your desired username to proceed.</div>');
$("#usernames").focus();
}
else if(emails == "")
{
$("#signup_status").html('<div class="info">Please enter your email address to proceed.</div>');
$("#emails").focus();
}
else if(reg.test(emails) == false)
{
$("#signup_status").html('<div class="info">Please enter a valid email address to proceed.</div>');
$("#emails").focus();
}
else if(passs == "")
{
$("#signup_status").html('<div class="info">Please enter your desired password to go.</div>');
$("#passs").focus();
}
else
{
var dataString = 'fullnames='+ fullnames + '&usernames=' + usernames + '&emails=' + emails + '&passs=' + passs + '&page=signup';
$.ajax({
type: "POST",
url: "save_details.php",
data: dataString,
cache: false,
beforeSend: function()
{
$("#signup_status").html('<br clear="all"><div style="padding-left:115px;"><font style="font-family:Verdana, Geneva, sans-serif; font-size:12px; color:black;">Please wait</font> <img src="images/loadings.gif" alt="Loading...." align="absmiddle" title="Loading...."/></div><br clear="all">');
},
success: function(response)
{
$("#signup_status").hide().fadeIn('slow').html(response);
}
});
}
}