Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Date range validation

Featured Replies

Hi

I have two fields "start_date" and "end_date".

I use validation for both of them :

Start_date -> start_date>=status(currentdate)

End_Date -> End_date<(start_date+62)

These validation does not seem to be working on the web.

I tried JS but I found only validation for empy fields.

1. why these validations does not work on the web (FMP 6 U!) ?

2. Any other way it can be done ?

Hi,

Works fine on the web for me.

I just did a quick test and the validation worked.

I am using FMU 6 as well

I set a field (StartDate) to date format

Then set the validation to validate by calculation:

StartDate>=status(currentdate)

Then tried on my web form to enter the StartDate as 01/01/2002 and it came up with my error page when I tried to submit.

Ed.

  • Author

Hi

Yes, bet the End_date validation is still not working.

BTW, I hope you checked with CWP and not IWP....

Hi,

I see the problem now, it is not that form validation does not work on the web, it is just your second validation does not work.

Your second validation will always return an error. The reason for this is the validation is based on the users input into the start date field.

The way FM is working will not handle this, it checks the validation rules before entering any data into the database off the web.

So when it is at the point of checking the validation for the 2nd field, the Start Date field is still blank, as FM is still at the validation stage, it has not yet entered the data off the web.

Therefore the validation on Start_Date + 62 is working out BLANK + 62, so your validation will fail as your End_Date will not meet that criteria.

You have 2 options really from what I know.

1. Split the input form into 2 pages.

The 1st page will ask for the start date, user enters this and submits, 2nd page asks for the end_date, user enters this and submits. At this point the database has a value for Start_Date so the validation will work.

2. Use Javascript as you said, I could probably come up with something to check this when I get a minute if you need me to.

Let me know which option you're going for and let me know if you need anymore help.

BTW, these may not be your only options, other members may be able to give you other options, but this is just what I know of it.

Regards

eD.

  • Author

Hi

It's too much work now to start desining Web page all over again.

I just gave you one example of validation that is not working... I have like 10 more...

Thts is why I will have to use JS...

I will need your help

I guess that after you show me one example I will manage.

TNX

Another way is to validate through calculated field. FM Field validations are very bad for WebCompanion, but field calculations not.

If you will make validating calculation field with result Yes or No, it is the easiest way to check that in CDML.

That can be programmed in Lasso as well.

  • Author

Hi

I Made a calc field : if(end_date>start_date,"y","n")

I've entered validation in End_date : c_field="Y".

Well, it looks like no matter what I enter, I get Error-507 (which is validation error...).

What could be the problem?

Is your calc field "unstored"? It probably should be.

You should check the result in CDML:

If calc field = Y

something

else

something else

Endif

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.