0

I understand that Bolt does only browser based validation but this is inadequate for real world cases where a fuzzy red border won't stop bad user input. Is there any way to actually enforce that required fields are filled before submission or just stop submit if required fields are still empty?

Otherwise, it seems counter intuitive to even have a field attribute of "required:true" that can still be submitted with empty values and thus never ever enforced. Even Wordpress won't allow that.

Chukky Nze
  • 720
  • 3
  • 13

1 Answers1

0

This is actually not a Bolt problem as such. Bolt is a CMS, front end forms are just that, front end... However...

In the upcoming Bolt 2, there is an extension in the marketplace called Bolt Forms that enables a full set of Symfony validators to be defined for form fields... I may even know the author personally ;-)

Bolt Forms is in a late-alpha stage at the moment, but I should have it ready in the time that Bolt 2 goes public. There are even several people using in production already.

Gawain
  • 1,568
  • 10
  • 8
  • Bolt Forms looks promising and I will definitely be adding this into future projects. Unfortunately, I'm in immediate need on a current project. I understand that Bolt handles validation on the client side. But, Bolt also handles saving the content on the BackEnd via app/src/Bolt/Storage.php and the saveContent method. Tweaking this method to refuse empty required fields or any other type of server-side documentation isn't documented. So a developer risks breaking Bolt to add these features and that time is pretty valuable – Chukky Nze Oct 23 '14 at 23:04
  • Totally understand the time pressure. saveContent() is not designed to for validation itself, past making sure that malicious content is not injected, and yes modifying it yourself will break the upgrade path. Hopefully we can fulfil your need for your next project. – Gawain Oct 24 '14 at 06:12