All Low add-ons are now owned by EEHarbor. Read the blog post.

Support archive

Date field and Channel Form Inline Errors

gtowle 2 Feb 2016 17:17 question, complete

Hi Low,

We have a channel form setup with inline errors. One of the fields is a Low Events date field. When viewing the form, the date field populates with the current date by default. The problem is that this behavior prevents the form from showing an error if the user doesn't add the appropriate date.

I'm wondering if there's a way to get around this natively. I have looked and don't see either a way to set a conditional and throw and error if the date is not in the future, for example, or any way to change how the date field is populated in the form (e.g. blank).

Thanks!

Replies

  1. Low 2 Feb 2016 23:00

    I'm not quite sure what you mean. Can you try and elaborate? Maybe add some screenshots as well as version info on EE, Low Events and PHP?

  2. gtowle 3 Feb 2016 00:42

    Hi Low,

    Thanks for the reply. The purpose of this Channel Entry Form we've built is for users to submit events to be considered for the organization's calendar.

    Attached is a screenshot from the form showing only the date field and a couple other fields. All three fields are required. I submitted the form (leaving the fields blank) to trigger the inline errors. As you can see, because the date field is populated with today's date by default, it does not register as an error (I assume because it's not blank). Ideally, we would want it to display as an error because the date must be some date in the future, not today's date.

    So I'm wondering if there's a native way to either a) have the date field appear blank by default, thus forcing the user to have to enter the date/time, or b) check to see if the date is today and if it is, display an error.

    EE version 2.9.2
    LE version 1.5.0
    PHP version 5.3.28

  3. Low 3 Feb 2016 08:34

    I'm afraid that's a "no" on both counts. You'd have to clear out the values with JavaScript and validate them yourself. LE only validates the values on form submit.

  4. gtowle 3 Feb 2016 15:50

    OK, thank you!