Saving pages when required fields are empty or min/max length doesn't match, is still possible


for a text-field and a textarea I’ve both set a minlength, maxlength and required property in the blueprint, and if I enter values into those fields, that don’t match the critera,
the field is just visually highlighted red, but the page can be saved anyway.

I was wondering, if it is intended to work that way?

I’m using kirby 3.5.1

Thanks in advance! :slightly_smiling_face:

Can you share a sample blueprint?

In draft status, Kirby doesn’t do any validation. Or does this also happen with published pages?

Thank You both!
Yes, the page is in draft mode. Thanks for pointing that out!
The problem is, the page shall never get published.
Do You have a suggestion how I can achieve the validation anyway?

What is the purpose of the page? Why don’t you want to publish it?

What you can do is use a update.before hook to throw an error if the page doesn’t validate, but then you have to do the checks in the hook yourself.

The pages ares created programatically and are only for the purpose of being edited by some panel-users and then later to be exported as a pdf / csv.
Maybe I should just publish them and restrict access in the frontend or so.

That would be what I would have suggested next, probably easier

1 Like

Thanks Sonja, I’ll take that aproach.
Have a great weekend!