<p>For form validation I typically use <a href="http://parsleyjs.org/" rel="nofollow">Parsley.js</a> - it's dead easy to use.</p>

CC BY-SA 4.0
2018-05-21T08:42:00.967Z
Dont recommend JS validation, its easy to by-pass and those with JS disabled wont be validated.
Laurence Cope
CC BY-SA 3.0
2016-10-20T13:50:55.700Z
2016-10-20T13:50:55.700Z
CreateSean
<p>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.</p>

<p>You could fork the plugin and make fields required by editing <a href="https://github.com/pixelandtonic/ContactForm/blob/master/contactform/models/ContactFormModel.php" rel="nofollow">https://github.com/pixelandtonic/ContactForm/blob/master/contactform/models/ContactFormModel.php</a></p>

CC BY-SA 3.0
2016-10-21T16:18:52.540Z
2016-10-21T16:18:52.540Z
Matt Wilcox
<p>I'm using the P&amp;T ContactForm Plugin. How can I make more field required?</p>

<p><a href="https://github.com/pixelandtonic/ContactForm" rel="nofollow">https://github.com/pixelandtonic/ContactForm</a></p>

<p>In the version from Github only the message and email field are required.</p>

<p>Is there a way to do this with the ContactForm Plugin? </p>

<templating><plugin-contactform>
ContactForm – How to make fields required
# ContactForm – How to make fields required

(Asked by: username_0 on 2016-10-20)

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?

**Tags:** templating, plugin-contactform


---

## 2 answers

### Answer by username_1 on 2016-10-20. Score: 2 | Accepted answer

For form validation I typically use [Parsley.js](http://parsleyjs.org/) - it's dead easy to use.

> **Comments:**
> **username_2**: Dont recommend JS validation, its easy to by-pass and those with JS disabled wont be validated.  

---

### Answer by username_3 on 2016-10-21. Score: 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>


---

