Jump to content
  • 0

Date Validation In Submission Form


Ben07080703

Question

Hi,

I have a submission form I am working on for employees to submit holiday. It has a "Start_Date" and an "End_Date" field selected by calendar.

What I would like to happen is when they pick a start date the entry is checked and an error message submitted for any of the following criteria

The Start Date entered is:

1. Before todays date

2. Before the most recent 1st March

3. After the next 1st March

If it is impossible or extremely hard to get it to recognise the last or the next March I am happy to update annually if I have to with a fixed date "01/03/2016" for instance and "01/03/2017".

I am very happy for the code to be run on submit and then the error to be displayed.

I can do very basic code but I am at a loss with numbers 2 and 3 in particular!

Any help would be appreciated.

Thanks

 

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0

Thanks ezlQchad,

I have been trying to attempt this today but I can't seem to get it to recognise my dates when I enter them in the rules. I must have something set wrong.

For example in one of the Rules I have created, I have:

________________________________

Criteria

Start_Date greater than or equal '03/01/2017'

Actions

Make Section 6 disabled

________________________________

When I go to try this in the preview, it disables section 6 when I select any day equal or above the 3rd day in any month from the calendar pop up. It appears to ignore month and year from the rule.

I am using English localization but I have tried changing the date around in the rule to '01/03'2017' and then it disables everything as it views 01 as the day and is ignoring everything else.

I have tried changing the "Precision" in the Rule Criteria to "Month and Year", "Date" or "Date and Time" but they still treat the first number as the day and ignore the rest.

What am I doing wrong??

In the submission form "Start_Date" is a text field that is required and has calendar pop up selected

In the underlying table "Start_Date" is Datatype Date/Time

Any help would be appreciated. Thank you.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...