1

I'm using the P&T ContactForm Plugin. How can I make more field required?

https://github.com/pixelandtonic/ContactForm

In the version from Github only the message and email field are required.

Is there a way to do this with the ContactForm Plugin?

2

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

|improve this answer|||||
  • Dont recommend JS validation, its easy to by-pass and those with JS disabled wont be validated. – Laurence Cope May 21 '18 at 8:42
0

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

|improve this answer|||||

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.