Expand my Community achievements bar.

SOLVED

Date field

Avatar

Former Community Member

Hi there,

I Was wondering is it possible to modify date field in the following way:

when users open the calendar built in the date field, they are not able to choose any future date. They are only able to choose today or any date in the past.

Is there some script for that?

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

I used the wrong date format ......try this one instead.

Paul

View solution in original post

6 Replies

Avatar

Former Community Member

You cannot stop them from choosing a date in the future but you can test the date they chose against the current date (whatever the

computer is set to) and then take appropriate action. This will only happen after they pick the date in the calendar.

Paul

Avatar

Former Community Member

Hi Paul,

Thanks for fast response!

How do I do that?

Avatar

Former Community Member

I created a sample for you .....the code is on the change event. Note that it uses FormCalc and not Javascript. It is easier in FormCalc that is why I chose that language.

paul

Avatar

Former Community Member

Hi Paul,

I tested the exemple you sent me. It works only when I hit october 10th or some date after it. If I hit october 9th, it doesn't work. In my form there is CurrentDate field. Maybe I should compare to it?

Avatar

Correct answer by
Former Community Member

I used the wrong date format ......try this one instead.

Paul

Avatar

Former Community Member

It works now!

Thank you Paul

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----