CMB2-Snippet-Library icon indicating copy to clipboard operation
CMB2-Snippet-Library copied to clipboard

"required" validation not working.

Open diegovogel opened this issue 5 years ago • 4 comments
trafficstars

I tried to use the snippet for validation of required fields, but it doesn't seem to be working. I'm not getting any errors (front end or console). It just doesn't seem to be doing anything. I noticed that the last commit was 5 years ago. Has the snippet been tested with Gutenberg?

diegovogel avatar Feb 20 '20 16:02 diegovogel

Very likely not, for the gutenberg testing.

We actually just had this same thing come up over at https://wordpress.org/support/topic/required-field-28/ in case that's not you as well. Basically the snippet as-is fails when it tries to select by #post because Gutenberg doesn't have that DOM element.

tw2113 avatar Feb 20 '20 17:02 tw2113

Ok thanks for the tip. I noticed that about the #post selector as well. I'll see if I can get it to work. Do you guys have any plans to update the snippet to work with Gutenberg? Or perhaps provide some other way of validating required fields?

diegovogel avatar Feb 20 '20 20:02 diegovogel

Mostly a case of finding the time to update/test/etc. We more than willingly accept pull requests as well to account for the two different editor experiences, in case you find a good working solution on your own and want to pass it along.

tw2113 avatar Feb 20 '20 20:02 tw2113

Sounds good, if I find a solution I'll share.

diegovogel avatar Feb 20 '20 20:02 diegovogel