Answers.Body: <p>If the fields are marked as required in your field layout, then they should fail validation even on the front-end, so it sounds like a bug to me.  Can you send a database backup as well as the template code you're using for the form over to support@buildwithcraft.com?</p>
  
  <p><strong>Update</strong></p>
  
  <p>The issue was that if your entries were set to be disabled by default, then Craft won't run any validation on them.  Just made a change so that if you use the <a href="https://github.com/pixelandtonic/guestentries" rel="nofollow">latest Guest Entries</a>, you'll have an additional plugin setting to enable/disable validation on a per section basis, regardless of the default status of the entry.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-06T12:22:01.430Z
Answers.Text: Quick question: I take it Craft not enforcing validation on Draft entries is something you want t kep that way. I guess both oprions make sense here, depending of your conception of draft entriess.
Answers.UserDisplayName: Jérôme Coupé
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-06T15:28:33.250Z
Answers.Text: Right... drafts are basically "works on progress" and you might want to save them before they are even completed.
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-07T08:27:53.047Z
Answers.Text: Hey Brad, quick question again. How can I display validation errors on the from end form ? Is the Edit in my original post the best way to do it ?
Answers.UserDisplayName: Jérôme Coupé
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-07T15:31:59.363Z
Answers.Text: Yup... if you want to get all of errors for the entry, then that'll work fine.
Answers.UserDisplayName: Brad Bell
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-07-02T15:13:22.387Z
Answers.LastActivityDate: 2014-07-03T07:55:17.087Z
Answers.LastEditDate: 2014-07-03T07:55:17.087Z
Answers.UserDisplayName: Brad Bell
Body: <p>This might be a bit of a Noob question but here I go:</p>
  
  <p>Using Guest Entries on a site and cannot figure out how to make certain fields required. Those fields are marked as required in the CP but, when using Guest Entries, entries are submitted even when required fields are not filled in.</p>
  
  <p>I can easily implement a front-end validation but I would like the validation to happen on the back-end before saving the entry as well.</p>
  
  <ul>
  <li>Should this happen automatically, am I missing something ?</li>
  <li>Do I have to create a validation "manually" and if so, how ?</li>
  </ul>
  
  <p><strong>EDIT:</strong></p>
  
  <p>After updating the plugin, this is how I displayed validation errors:</p>
  
  <pre><code>{% if entry.errors is defined %}
      {% for errorField, error in entry.errors %}
          {% for errorMessage in error %}
          &lt;ul class="form-errors"&gt;
              &lt;li&gt;{{ errorField }} - {{ errorMessage }}&lt;/li&gt;
          &lt;/ul&gt;
          {% endfor %}
      {% endfor %}
  {% endif %}
  </code></pre>
  
Tags: <guest-entries><required>
Title: Make fields required when using Guest Entries
ThreadText: # Make fields required when using Guest Entries
  
  (Asked by: username_0 on 2014-07-02)
  
  This might be a bit of a Noob question but here I go:
  
  Using Guest Entries on a site and cannot figure out how to make certain fields required. Those fields are marked as required in the CP but, when using Guest Entries, entries are submitted even when required fields are not filled in.
  
  I can easily implement a front-end validation but I would like the validation to happen on the back-end before saving the entry as well.
  
  * Should this happen automatically, am I missing something ?
  * Do I have to create a validation "manually" and if so, how ?
  
  **EDIT:**
  
  After updating the plugin, this is how I displayed validation errors:
  
  ```
  {% if entry.errors is defined %}
      {% for errorField, error in entry.errors %}
          {% for errorMessage in error %}
          <ul class="form-errors">
              <li>{{ errorField }} - {{ errorMessage }}</li>
          </ul>
          {% endfor %}
      {% endfor %}
  {% endif %}
  
  ```
  
  **Tags:** guest-entries, required
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2014-07-02. Score: 4 | Accepted answer
  
  If the fields are marked as required in your field layout, then they should fail validation even on the front-end, so it sounds like a bug to me. Can you send a database backup as well as the template code you're using for the form over to support@buildwithcraft.com?
  
  **Update**
  
  The issue was that if your entries were set to be disabled by default, then Craft won't run any validation on them. Just made a change so that if you use the [latest Guest Entries](https://github.com/pixelandtonic/guestentries), you'll have an additional plugin setting to enable/disable validation on a per section basis, regardless of the default status of the entry.
  
  > **Comments:**
  > **username_0**: Quick question: I take it Craft not enforcing validation on Draft entries is something you want t kep that way. I guess both oprions make sense here, depending of your conception of draft entriess.  
  > **username_1**: Right... drafts are basically "works on progress" and you might want to save them before they are even completed.  
  > **username_0**: Hey username_1, quick question again. How can I display validation errors on the from end form ? Is the Edit in my original post the best way to do it ?  
  > **username_1**: Yup... if you want to get all of errors for the entry, then that'll work fine.  
  
  ---
  
  