Forum Replies Created
- AuthorPosts
Rafal
ParticipantHi.
Thank you, it works great!Rafal
ParticipantProblem solved. Previously I had “Save to database” unchecked for radio buttons. Now the data saves correctly when I check this option.
- This reply was modified 2 years, 6 months ago by
Rafal.
Rafal
ParticipantI noticed that the data is saved in the columns, but not in the main panel (single entry). I checked the box “show empty fields”.
Attachments:
You must be logged in to view attached files.Rafal
ParticipantThank you, it works great
Regards,
Rafal.Rafal
ParticipantThanks for your quick help.
I have one last problem.
I would like to change validator text for custom inputs.So I replace:
$field->addValidator(new Quform_Validator_Required());
to:
$field->addValidator('required', array( 'messages' => array('required' => 'Yardage is required!') ));
according to the documentation: https://support.themecatcher.net/quform-php/customisation/validators/changing-the-required-error-message-this-field-is-required
But it doesn’t work for me.
Full code:
add_filter('quform_pre_validate_1', function (array $result, Quform_Form $form) { $field = $form->getElement('quform_1_53'); if($field instanceof Quform_Element_Field) { /* $field->addValidator(new Quform_Validator_Required()); */ $field->addValidator('required', array( 'messages' => array('required' => 'Yardage is required!') )); } return $result; },10, 2);
Rafal
ParticipantThank 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 2 years, 9 months ago by
Rafal.
- This reply was modified 2 years, 6 months ago by
- AuthorPosts