Support » Plugin: Site Reviews » Validation rules custom field

  • Resolved nartoof

    (@nartoof)


    Hi,

    I got a review form displayed on the product category archives page.

    I only got 3-4 products per category then I did add a custom select field to let user choose the product he is reviewing.

    site-reviews/config/forms/submission-form is working very well šŸ™‚
    site-reviews/submission-form/order no problem either

    I do assign the product id to the review with
    site-reviews/review/created and it’s working perfectly.

    But when I try to filter the easiest to make the field required, it doesn’t work. I tried to filter on a custom select and a custom input text, there is no class ‘glsr-required’ added, and I can submit the form with an empty field…

    Here is my filter :

    add_filter('site-reviews/validation/rules', function ($rules) {
        $rules['e-books'] = 'required';
        $rules['test_input_text'] = 'required';
        
        return $rules;
    });

    Where the key is the same as the $config array defined in the ‘site-reviews/config/forms/submission-form’ filter…

    Do you have any idea ?

    Thank you very much for your help šŸ™‚

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.