Forum Replies Created

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • in reply to: Set default entry label #37071
    Rafal
    Participant

    Hi.
    Thank you, it works great!

    in reply to: Different fields on specific pages and one form #35029
    Rafal
    Participant

    Problem 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.
    in reply to: Different fields on specific pages and one form #35025
    Rafal
    Participant

    I 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.
    in reply to: Get value from custom HTML input structure #34794
    Rafal
    Participant

    Thank you, it works great 🙂
    Regards,
    Rafal.

    in reply to: Get value from custom HTML input structure #34785
    Rafal
    Participant

    Thanks 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);
    
    • This reply was modified 2 years, 9 months ago by Rafal.
    • This reply was modified 2 years, 9 months ago by Rafal.
    • This reply was modified 2 years, 9 months ago by Rafal.
    in 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 2 years, 9 months ago by Rafal.
Viewing 6 posts - 1 through 6 (of 6 total)
Be inspired. © 2025 ThemeCatcher Ltd. 20-22 Wenlock Road, London, England, N1 7GU | Company No. 08120384 | Built with React | Privacy Policy