Reply To: Get value from custom HTML input structure

Home Forums Quform WordPress Get value from custom HTML input structure Reply To: Get value from custom HTML input structure

#34778
Rafal
Participant

Thank you for your help! The solution is very simple.
Could I display the error (validator) below the custom input?
I tried:


add_filter('quform_element_valid_1_53', function ($valid, $value, Quform_Element_Field $element) {
    if (empty($value)) {
        $element->addError('The field is required');
        $valid = false;
    }
    return $valid;
}, 10, 3);

but it doesn’t work for me.
if I set the attribute “required”, the form is sent despite the empty value


<input class="quantity-field form-control input-number quform-input quform-input-text quform-cf quform-field-yardage" max="1000" min="1" name="quform_1_53" step="1" type="number" required />
  • This reply was modified 1 year, 6 months ago by Rafal.
Be inspired. © 2024 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy