Home › Forums › Calendar Products › Community Events › Require event start date not working
- This topic has 7 replies, 4 voices, and was last updated 7 years, 11 months ago by Jesse Simmers.
-
AuthorPosts
-
May 25, 2016 at 11:45 am #1118828Jesse SimmersParticipant
I used this page to setup my required fields but start date doesn’t seem to notice if the field is empty when submitted.
https://theeventscalendar.com/knowledgebase/required-fields-for-events-submission-form/I need this field required because people are forgetting to enter their event date. By default it uses todays date and if they forget to change the date their event gets submitted with todays date which is no good. I removed the value that was populating todays date so the field is now empty but the validation does not work.
To make sure it wasn’t my value modification causing the issue I put all the original code back with todays date as the value and clicked in the field and backspaced the date out so the field was empty and still didn’t get a notification the field was required.
May 26, 2016 at 10:23 am #1119213HunterModeratorHello Jesse,
Welcome back!
We cannot help with custom coding, so unfortunately you will have to take the reins on this. Please read this page for more information: https://theeventscalendar.com/knowledgebase/what-support-is-provided-for-license-holders/
Please note, however, that if you use this code verbatim it won’t do anything – it simply illustrates the basic process and you would of course need to amend the initial test condition and error message.
I’d like to at least try and help you get going in the right direction, though, so if you don’t mind, can you specify how you implemented this customization? If possible, please copy and paste your unedited custom code into a Gist at http://gist.github.com, and then share a link to that Gist with me here.
Thank you for understanding and have a good rest of your Thursday.
May 26, 2016 at 10:58 am #1119230Jesse SimmersParticipantCopying and pasting the first function provided on that page DOES work for all the fields I need without customization with the exception of the start and end date. I am using the following and it works just fine with the exception of the event start and end date. The page mentions certain fields can’t be required using the above approach but the date fields are not included.
https://gist.github.com/jcsimmers/bcaf70274ad2bf3b8dfad03d158aeac3
May 27, 2016 at 11:25 am #1119864HunterModeratorThanks for the response,
I understand the majority of the filters do work ‘out-of-the-box’, so the start date field should work as it’s not mentioned in the fields that can’t be marked as required; but the customization you’re seeking is beyond simply marking the start date as “required”.
Please send over that gist as mentioned in my previous response and we’d be glad to take a look. Thanks and let me know if anything I’ve said needs clarity. Have a good weekend 🙂
May 27, 2016 at 12:18 pm #1119887Jesse SimmersParticipantThanks for the response!
With or without my customization it does not work so lets completely disregard my customization and see if we can get it working. I agree the date required should work out of the box without other customization but it does not, at least for me.
Here is a scenario…. Lets say I have a completely unmodified submission form. The only customization is the function in my previous post (the out of the box one for required fields). In theory all fields mentioned in my function should be required and throw an error if those fields are empty when the form is submitted.
If I scroll to the bottom of the form and click submit I get a message that says all of those fields are required but it does not say start and end date are required. This is most likely because those fields are not empty. So I go ahead and remove all text from the date fields and click submit but still no required message regarding dates.
There is no customization outside of the documentation in this scenario so my thoughts are that if the date required message is not coming up at all then it’s a bug. If it’s not a bug then the documentation is incorrect.
Are you able to trigger the date required message in a test environment on your end?
May 30, 2016 at 5:18 pm #1120514HunterModeratorHey and welcome back,
I tested how you described and indeed, no error was displayed after I deleted the start date from the event submission form. It turns out the datepicker fields are exceptions and that’s because the datepicker code tries to ensure they are populated with a value (defaulting to today’s date) as soon as the form is submitted. We’ll update the knowledgebase post, but I’m afraid working around this would be a customization you’d need to drive forward by yourself._
I wish I had a better answer, but one other recommendation I have would be to check out this list of available developers for hire. Good luck and thank you for your understanding.
June 14, 2016 at 9:35 am #1126794Support DroidKeymasterThis topic has not been active for quite some time and will now be closed.
If you still need assistance please simply open a new topic (linking to this one if necessary)
and one of the team will be only too happy to help. -
AuthorPosts
- The topic ‘Require event start date not working’ is closed to new replies.