• Well i try to add the password to the contact field, but the form accepts what ever i put in to the password field. I want the password to reject the people if they put in the wrong password.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author kimipooh

    (@kimipooh)

    This plugin simply adds an input box for <input type=”password”>. This plugin simply adds an input box for <input type=”password”>. In other words, the characters you enter are hidden, but it accepts any input.

    If you add the validation check in the item of Contact Form 7, please add the following code to “functions.php” in the theme folder.

    ex.
    1. limit the number of characters to at least 10.
    2. include one or more numbers, upper and lower case letters, mark.

    function wpcf7_validate_password($result,$tag){ 
      $tag = new WPCF7_Shortcode($tag);
      $name = $tag->name;
      $value = isset($_POST[$name]) ? trim(wp_unslash(strtr((string) $_POST[$name], "\n", " "))) : "";
      if(strlen($value) < 10){
      	$result->invalidate($tag, "Please limit the number of characters to at least 10.");
      }else{
      	if(!
      	(preg_match("/([a-z].*[A-Z])|([A-Z].*[a-z])/", $value) &&
      	 preg_match("/([0-9])/", $value) &&
      	 preg_match("/([!,%,&,@,#,$,^,*,?,_,~])/", $value))
      	){
          $result->invalidate($tag, "Please include one or more numbers, upper and lower case letters, mark.");
          }
      }
      return $result;
    }
    add_filter('wpcf7_validate_password',  'wpcf7_validate_password', 11, 2);
    add_filter('wpcf7_validate_password*', 'wpcf7_validate_password', 11, 2);
    Thread Starter frtbkr

    (@frtbkr)

    Thank you!

    Plugin Author kimipooh

    (@kimipooh)

    I’m happy to release version 2.5.
    The version supports two restrictions; “Number of characters”, “Password Strength; for the password field.

    1. password_min
    Required more than the specified number of characters the input.

    2. password_stregth
    I prepared 4 types.
    1 = Numbers only
    2 = Include letters and numbers
    3 = Include upper and lower case letters and numbers
    4 = Include upper and lower case letters, numbers, and marks

    ex. [password? example? password_min=10? password_strength=4]
    Required more than the 10 number of characters the input and include upper and lower case letters, numbers, and marks

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Help neded’ is closed to new replies.