Custom Fields
Re-Envisioned
Support MB Frontend Submission Image/file field does not take validation

This topic contains 5 replies, has 4 voices, and was last updated by  Anh Tran 2 months, 1 week ago.

  • Creator
    Topic
  • #12395

    calpaq
    Participant

    Hi Anh,
    How do I make a file upload field a required field. I tried using required attribute but it doesn’t work.
    Thanks & Regards,
    Calpaq

Viewing 5 replies - 1 through 5 (of 5 total)
  • Author
    Replies
  • #12397

    Farheen
    Moderator

    Hello Calpaq

    Can you specify what steps are you following.

    #12398

    calpaq
    Participant

    Please have a look to upload field I have defined

    'fields' => array( 
        array( 
            'id' => 'eto_personal_photograph', 
            'type' => 'image', 
            'name' => esc_html__( 'Upload your photograph: ', 'tmi' ), 
            'desc' => esc_html__( 'Your photograph can only be in .gif, .jpg or .png format.', 'tmi' ), 
            'max_file_uploads' => '1', 
            'attributes' => array( 
                'required' => array( 'required' => "true" ), 
            ), 
            'columns' => 12, 
        ),
    )

    will this help?
    Regards

    #13237

    handy
    Participant

    Any update for this?

    #13239

    calpaq
    Participant

    Hi handy,
    The only way I find out is, take the file field out of the group and take it as individual field.
    Regards

    #13299

    Anh Tran
    Keymaster

    Hey guys,

    This is a bug and I’ve just fixed it on Github. It’s available in the new version soon.

Viewing 5 replies - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.