403Webshell
Server IP : 103.234.187.230  /  Your IP : 216.73.216.216
Web Server : Apache
System : Linux lserver42043-ind.megavelocity.net 3.10.0-1160.108.1.el7.x86_64 #1 SMP Thu Jan 25 16:17:31 UTC 2024 x86_64
User : apache ( 48)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/html/dcb/script/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/dcb/script/complaint_form.js
/* 
	author: istockphp.com
*/
jQuery(function($) {
    var validation_holder;

    $("form#ComplaintForm input[name='button2']").click(function() {

    var validation_holder = 0;
         
        var fname 			= $("form#ComplaintForm input[name='fname']").val();
        var fname_regex	                = /^[A-Za-z]{2,40}$/;
        var lname 			= $("form#ComplaintForm input[name='lname']").val();
        var lname_regex		        = /^[A-Za-z]{2,20}$/;
        var email 			= $("form#ComplaintForm input[name='email']").val();
        var email_regex 	        = /^[\w%_\-.\d]+@[\w.\-]+.[A-Za-z]{2,6}$/; // reg ex email check
        var address                     = $("form#ComplaintForm textarea[name='address']").val();
        var country                     = $("form#ComplaintForm input[name='country']").val();
        var country_regex	        = /^[A-Za-z]{1,40}$/;
        var state 			= $("form#ComplaintForm select[name='state_id']").val(); // month
        var pin_code                    = $("form#ComplaintForm input[name='pin_code']").val();
        var pin_code_regex		= /^[0-9]{6,6}$/; // reg ex phone check
        var country_code                = $("form#ComplaintForm input[name='country_code']").val();
        var country_code_regex		= /^[0-9]{2,3}$/; // reg ex phone check
        var area_code                   = $("form#ComplaintForm input[name='area_code']").val();
        var area_code_regex		= /^[0-9]{2,3}$/; // reg ex phone check
        var landline_no 		= $("form#ComplaintForm input[name='landline_no']").val();
        var landline_no_regex		= /^[0-9]{8,20}$/; // reg ex phone check
        var phone 			= $("form#ComplaintForm input[name='mobile_no']").val();
        var phone_regex		        = /^[0-9]{10,20}$/; // reg ex phone check
        var account_no 			= $("form#ComplaintForm input[name='account_no']").val();
        var account_no_regex		= /^[0-9]{14,15}$/; // reg ex phone check
        var complaint_detail            = $("form#ComplaintForm textarea[name='complaint_detail']").val();
        var captcha                     = $("form#ComplaintForm input[name='captcha']").val();
        var terms_condition             = $("form#ComplaintForm input[name='terms_condition']");

        /* validation start */	
        if(fname === "" || fname === "First name *") {
                $("span.val_fname").html("Enter first name").addClass('validate');
                validation_holder = 1;
        } else {
                if((!fname_regex.test(fname)) && (fname !== "First name *")){ // if invalid email
                        $("span.val_fname").html("Enter only Alphabetic name").addClass('validate');
                        validation_holder = 1;
                } else {
                        $("span.val_fname").html("");
                }
        }
        if(lname === "" || lname === "Last name *") {
                $("span.val_lname").html("Enter last name").addClass('validate');
                validation_holder = 1;
        } else {
                if((!lname_regex.test(lname)) && (lname !== "Last name *")){ // if invalid email
                        $("span.val_lname").html("Enter only Alphabetic name").addClass('validate');
                        validation_holder = 1;
                } else {
                        $("span.val_lname").html("");
                }
        }
        if(email === "" || email === "Email ID *") {
                $("span.val_email").html("Enter email id").addClass('validate');
                validation_holder = 1;
        } else {
                if((!email_regex.test(email)) && (email !== "Email ID *")){ // if invalid email
                        $("span.val_email").html("Invalid Email").addClass('validate');
                        validation_holder = 1;
                } else {
                        $("span.val_email").html("");
                }
        }
        
        if(address === "" || address === "Address *") {
                $("span.val_address").html("Enter address").addClass('validate');
                validation_holder = 1;
        } else {
                $("span.val_address").html("");
        }
        
        if(country == "" || country === "Country *") {
                $("span.val_country").html("Enter country").addClass('validate');
                validation_holder = 1;
        } else {
                if(!country_regex.test(country)){ // if invalid email
                        $("span.val_country").html("Enter only alphbatic name").addClass('validate');
                        validation_holder = 1;
                } else {
                        $("span.val_country").html("");
                }
        }
        
        if(state == "") {
                $("span.val_state").html("Select state").addClass('validate');
                validation_holder = 1;
        } else {
                $("span.val_state").html("");
        }
        
        if(pin_code === "" || pin_code === "Pin code") {
                $("span.val_pin_code").html("Enter pin code").addClass('validate');
                validation_holder = 1;
        } else {
                if(!pin_code_regex.test(pin_code)){ // if invalid email
                        $("span.val_pin_code").html("Invalid Pin code").addClass('validate');
                        validation_holder = 1;
                } else {
                        $("span.val_pin_code").html("");
                }
        }
        
        if(country_code !== "" && country_code !== "Country code") {
            if((isNaN(country_code)) && (country_code !== "Country code")){ // if Country Code
                $("span.val_country_code").html("Enter Numeric value").addClass('validate');
                validation_holder = 1;
            }
            else if((!country_code_regex.test(country_code)) && (country_code !== "Country code")){ // if invalid phone
                     $("span.val_country_code").html("Invalid Country Code").addClass('validate');
                     validation_holder = 1;
            }
            else {
                    $("span.val_country_code").html("");
            }
        }else {
            $("span.val_country_code").html("");
        }    
        
        if(area_code !== "" && area_code !== "Area code") {
            if((isNaN(area_code)) && (area_code !== "Area code")){ // if Country Code
                $("span.val_area_code").html("Enter Numeric value").addClass('validate');
                validation_holder = 1;
            }
            else if((!area_code_regex.test(area_code)) && (area_code !== "Area code")){ // if invalid phone
                     $("span.val_area_code").html("Invalid Area Code").addClass('validate');
                     validation_holder = 1;
            }
            else {
                    $("span.val_area_code").html("");
            }
        } 
        
        if((landline_no === "" || landline_no === "Landline no. *") && (phone === "" || phone === "Mobile no. *")) { 
                $("span.val_phone").html("Enter Landline No or Mobile No.").addClass('validate');
                validation_holder = 1;
        } else { 
            $("span.val_phone").html("");
        } 
        if(landline_no !== "" && landline_no !== "Landline no. *") {  
                if((!landline_no_regex.test(landline_no)) && (landline_no !== "Landline no. *")){ // if invalid phone
                 $("span.val_landline_no").html("Invalid Landline No.").addClass('validate');
                 validation_holder = 1;
                 }
                 else {
                    $("span.val_landline_no").html("");
                 }  
        } 
        if((phone !== "" && phone !== "Mobile no. *")) {  
                if((!phone_regex.test(phone)) && (phone !== "Mobile no. *")){ // if invalid phone
                 $("span.val_phone").html("Invalid Mobile No.").addClass('validate');
                 validation_holder = 1;
                 }
                 else {
                    $("span.val_phone").html("");
                 }    
        }
        
        if(account_no === "" || account_no === "Account Number *") {
                $("span.val_account_no").html("Enter account no").addClass('validate');
                validation_holder = 1;
        } else {
                if(!account_no_regex.test(account_no)){ // if invalid email
                        $("span.val_account_no").html("Invalid Account No").addClass('validate');
                        validation_holder = 1;
                } else {
                        $("span.val_account_no").html("");
                }
        }
        
        if(complaint_detail === "" || complaint_detail === "complaint *") {
                $("span.val_complaint_detail").html("Enter complaint detail").addClass('validate');
                validation_holder = 1;
        } else {
                $("span.val_complaint_detail").html("");
        }
        
        if(captcha == "" || captcha === "Captcha code *") {
                $("span.val_captcha").html("Enter captcha code").addClass('validate');
                validation_holder = 1;
        } else {
                $("span.val_captcha").html("");
        }
        
        if(terms_condition.is(':checked') == false) {
                $("span.val_terms_condition").html("Check terms & conditions").addClass('validate');
                validation_holder = 1;
        } else {
                $("span.val_terms_condition").html("");
        }
        
        if(validation_holder == 1) { // if have a field is blank, return false
                $("p.validate_msg").slideDown("fast");
                return false;
        }  validation_holder = 0; // else return true
        /* validation end */	
        
        
    }); // click end 
    
     
     
}); // jQuery End


function isNumber(evt) {
    evt = (evt) ? evt : window.event;
    var charCode = (evt.which) ? evt.which : evt.keyCode;
    if (charCode > 31 && (charCode < 48 || charCode > 57)) {
            return false;
    }
    return true;
}

Youez - 2016 - github.com/yon3zu
LinuXploit