Home › Forums › Quform WordPress › Get value from custom HTML input structure › Reply To: Get value from custom HTML input structure
September 30, 2022 at 2:08 pm #34778
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, 2 months ago by
Rafal.