Type 'file' field validation - Does not work on Frontend Form?

Support MB Frontend Submission Type 'file' field validation - Does not work on Frontend Form?

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #49204
    CodogCodog
    Participant

    Hi there,
    following your validation documentation here: https://docs.metabox.io/validation/ I used your suggested methodology to add disallowed file type validation on a 'type'=> 'file' custom field like this:

    
    'fields'     => [
        [
            'name' => 'Uploaded Files',
            'id'   => 'my_files',
            'type' => 'file',
        ],
    ],
    'validation' => [
        'rules'    => [
            '_file_my_files[]' => [
                'extension' => 'pdf',
            ],
        ],
        'messages' => [
            '_file_my_files[]' => [
                'extension' => 'file extension not allowed',
            ],
        ],
    ],
    

    Strictly following the validation page instructions - On my MB Frontend Form, using this method, I do not see any validation feedback on my custom field when the file type is PDF? Can you confirm this works for you at your end on a frontend form?

    Cheers

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.