Image field 'required' not working

Support MB Builder Image field 'required' not workingResolved

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #21988
    BucketPressBucketPress
    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.

    #21996
    Long NguyenLong 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
    bucketpressbucketpress
    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
    bucketpressbucketpress
    Participant

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

    #23748
    BucketPressBucketPress
    Participant

    Has a solution to this issue been found?

    #23763
    Long NguyenLong Nguyen
    Moderator

    Hi,

    Please update the newest version of Meta Box 5.3.6 to fix this issue.

    #44302
    contact@upthrive.ca[email protected]
    Participant

    still not fixed. Its not working. I have been struggling with this. I see this has been an issue for years.

    #45104
    Leo HermantoLeo Hermanto
    Participant

    Hi

    I am facing the same issues, is there already a solution to this? I tried all image upload even with logged in user is still submitted even when its empty and set to required.

    #45127
    PeterPeter
    Moderator

    Hello,

    I add a field image_upload to the field group, enable Required and see the validation works correctly when submitting the post without adding an image.

    Please try on a clean installation of WordPress and check this issue again.

    #45130
    Leo HermantoLeo Hermanto
    Participant

    I manage to solve this only with Image only.

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