1

What would be the best way to add some custom validation rules on forms submitted on the front-end without using specific field types for it?

I'm using the Guest Entries plugin that allows anonymous posts to the targeted section. I'm new to Yii and Craft CMS and I cannot seem to find a way to extend the validation rules for the EntryModel (at least I suspect it needs to get done there).

1 Answer 1

1

If your validation rules are truly custom and aren't covered by the default Craft validation rules, the only way I can think of getting them into the Guest Entries EntryModel is to fork the plugin and add your own MyPluginEntryModel that extends EntryModel adding a rules method with your custom validation logic.

Read here for more details on that.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.