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?


For form validation I typically use Parsley.js - it's dead easy to use.

  • Dont recommend JS validation, its easy to by-pass and those with JS disabled wont be validated. May 21 '18 at 8:42

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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