Custom Fields
Re-Envisioned
Support Meta Box Builder Image field ‘required’ not working

  • Creator
    Topic
  • #21988
    BucketPress
    Participant

    I’m using the builder to set up a Image field, and checked the ‘Required’ checkbox. However, the user is still allowed to submit the form, even though no file was chosen while filling the form.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Author
    Replies
  • #21996
    Long Nguyen
    Moderator

    Hi,

    The field image as the same as field image_upload so please use the field image_upload instead of image. I’m going to discuss with the developer team to cover this case.
    https://docs.metabox.io/fields/image-upload/

    Thank you.

    #21998
    bucketpress
    Participant

    Based on metabox docs, I am unable to use other forms of image fields (e.g. image upload, image advanced, single image) because they all require user permissions (i.e user needs to be logged in). My form is used on the frontend before a user is logged in and does not have any edit capabilities.

    Ok, hopefully the dev team solves this bug soon, because setting ‘Required’ to the field has no effect at all. I see that the code adds a data-required attr, but it should be adding a required attr.

    #21999
    bucketpress
    Participant

    I have also tried making use of custom attributes to set attributes.required – this has no effect on the generated html form.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.