function checkpassword(){
var password_value = $("#reg-password").val();
if(password_value === ""){
//password emtpy
$("#password-result").html('Please make a password');
$("#password-result").css('color', 'red');
$('#reg-password').css('border-color', 'red');
}else if (password_value.length < 6){
//password is too shot 6 digi
$("#password-result").html('Your password is too short.');
$("#password-result").css('color', 'red');
$('#reg-password').css('border-color', 'red');
}else{
//password passed
$("#password-result").html('');
$('#reg-password').css('border-color', '#dfe0e6');
return true;
}
return false;
}
this is a validation function with client side , i wanted to make a sever side which will active the this function , exp if
if(isset($_POST['submit'])){
if(empty($_POST['submit'])){
//some how active js (password_value === "");
}
}
how should i make those or i am making this validation wrong.