I'm using the P&T ContactForm Plugin. How can I make more field required?
In the version from Github only the message and email field are required.
Is there a way to do this with the ContactForm Plugin?
Craft CMS Stack Exchange is a question and answer site for administrators, end users, developers and designers for Craft CMS. It only takes a minute to sign up.Sign up to join this community
For form validation I typically use Parsley.js - it's dead easy to use.
There isn't a way (as far as I am aware) to make fields required from within your template or the plugin UI. The suggestion above fails as soon as JS is disabled and no JS solution should be relied on for validation.
You could fork the plugin and make fields required by editing https://github.com/pixelandtonic/ContactForm/blob/master/contactform/models/ContactFormModel.php