• Resolved Kadai

    (@kadai)


    Hello,
    i just bought this plugin and i need your help. I want to add custom validation to input. I have added custom input field with meta name “pwz” and i have function like this. How to connect it?

    		function check_pwz_number ($number)
    
    		{
    		    if (strlen($number) != 7 || preg_match('/^0+$/', $number)) return false;
    		    $c = (int)$number[0];
    		    $n = substr($number, 1);
    		    $s = 0;
    		    for ($i = 1; $i <= 6; $i ++) $s += (int)$n[$i - 1] * $i;
    		    return ($s % 11) == $c ? true : false;
    		}

    Thanks
    K

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

The topic ‘Custom Validation’ is closed to new replies.