• Resolved tuythach

    (@tuythach)


    I have a custom blog category on my site with mandatory description fields. Whenever I attempt to create a new blog category entry, entering just the title (without filling out the description fields), the system allows me to save the entry without any alerts for the missing data. The title gets stored, but the category is created with blank description fields.

    On the other hand, if I fill out some (but not all) of the mandatory description fields and try to save, the system again permits saving without warnings. However, in this case, none of the partially filled description data is stored – only the title remains.

    Could you please explain why the mandatory field validation seems to be inconsistent and not working as expected? I need to ensure that all required fields are properly populated before a new blog category entry can be saved.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Paul Clark

    (@pdclark)

    Due to limitations in the Block Editor, required fields are not yet able to provide validation feedback.

    One workaround is disable the REST API for the post type, causing the classic Tiny MCE editor the be used. In this case, a validation error will display one field at a time, requiring the using to go back in the browser to edit.

    Other than that, at this time, within the Block Editor, live validation feedback is only available with custom JavaScript, for example by monitoring user input as it occurs in combination with the fields API https://docs.pods.io/code/dfv-js-api/

    2candela2

    (@2candela2)

    @tuythach did you get it working? I need to validate a required post field and for me is too complicated to make it with dfv-js-api and I don’t find any example. Could you please put the code for validating one field? Thanks

    rico34

    (@rico34)

    @pdclark is this a problem that the pods project can fix or is working on fixing?

    I have just encountered the same problem which unfortunately I was not aware of before. For me and my website users it is important to know if the Block Editor will work together with the correct validation of required fields in the near future. People are getting used to use the Block Editor. So switching every website where I use custom fields back to the Tiny MCE editor is hard to explain to regular users.
    I have not looked too much into the alternative suggested solution by using dfv-js-api. But an information on the future of this problem would be very much appreciated.

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