Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
ynormeco
/
.trash
/
studywallet
/
js
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/ynormeco/.trash/studywallet/js/user_chker_pl.js
$(document).ready(function(){ $('#plusername').keyup(function(){ // Keyup function for check the user action in input var Username = $(this).val(); // Get the username textbox using $(this) or you can use directly $('#username') var UsernameAvailResult = $('#username_avail_result_pl'); // Get the ID of the result where we gonna display the results if(Username.length > 2) { // check if greater than 2 (minimum 3) UsernameAvailResult.html('Loading..'); // Preloader, use can use loading animation here var UrlToPass = 'action=username_availabilitypl&plusername='+Username; $.ajax({ // Send the username val to another checker.php using Ajax in POST menthod type : 'POST', data : UrlToPass, url : 'pages/checker_pl.php', success: function(responseText){ // Get the result and asign to each cases UsernameAvailResult.html('<span class="success">'+responseText+'</span>'); } }); }else{ UsernameAvailResult.html('Enter atleast 3 characters'); } if(Username.length == 0) { UsernameAvailResult.html(''); } }); $('#password, #plusername').keydown(function(e) { // Dont allow users to enter spaces for their username and passwords if (e.which == 32) { return false; } }); $('#stud_id').keyup(function(){ // Keyup function for check the user action in input var Username = $(this).val(); // Get the username textbox using $(this) or you can use directly $('#username') var UsernameAvailResult = $('#stud_id_avail_result'); // Get the ID of the result where we gonna display the results if(Username.length > 2) { // check if greater than 2 (minimum 3) UsernameAvailResult.html('Loading..'); // Preloader, use can use loading animation here var UrlToPass = 'action=username_availability&username='+Username; $.ajax({ // Send the username val to another checker.php using Ajax in POST menthod type : 'POST', data : UrlToPass, url : 'pages/new_user_chk.php', success: function(responseText){ // Get the result and asign to each cases if(responseText == 0){ UsernameAvailResult.html('<span class="success">Username is available</span>'); } else if(responseText > 0){ UsernameAvailResult.html('<span class="error">Username is Not Available</span>'); } else{ alert('Problem with sql query'); } } }); }else{ UsernameAvailResult.html('Enter atleast 3 characters'); } if(Username.length == 0) { UsernameAvailResult.html(''); } }); });