• Hi All,

    I’m attempting to use this plugin and it does the job expected, however, there’s one issue affecting form validation. Validation of the submitted entry does not work.

    The problem lies within recommend-us.php at line 131 onwards,

    $validData = true;
                    if ($rName == '') {
                        $output .= 'You must include your name.';
                        $validData = false;
                    } else if ($rTitle == '') {
                        $output .= 'You must include a title for your review.';
                        $validData = false;
                    } else if ($rText == '') {
                        $output .= 'You must write some text in your review.';
                        $validData = false;
                    } else if ($rRating == 0) {
                        $output .= 'Please give a rating between 1 and 5 stars.';
                        $validData = false;
                    } else if ($rEmail != '') {
                        $firstAtPos = strpos($rEmail,'@');
                        $periodPos  = strpos($rEmail,'.');
                        $lastAtPos  = strrpos($rEmail,'@');
                        if (($firstAtPos === false) || ($firstAtPos != $lastAtPos) || ($periodPos === false)) {
                            $output .= 'You must provide a valid email address.';
                            $validData = false;
                        }
                    }

    But the validation does not work for any blank field. Are there any solutions?

    https://wordpress.org/plugins/recommend-us/

  • The topic ‘Form Validation doesn't work’ is closed to new replies.