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 Answers 2

2

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

1
  • Dont recommend JS validation, its easy to by-pass and those with JS disabled wont be validated. Commented May 21, 2018 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

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.