Skip to main content
Participant
April 18, 2023
Question

Pdf form condition on a date

  • April 18, 2023
  • 1 reply
  • 1813 views

Hello All, 

 

I'm working on a new user creation form.

User have to enter an end of mission date.

I would like to test the date entered.

The form as a date aka start of mission date.

If the request is made before October the 1st than maximum date possible for end of mission date is 31/12 of the year of the start of mission date

If the request is made after October the 1st than maximum date possible for end of mission date is 31/12 of the year of the start of mission date +1 

 

Is it possible to prevent user  to enter a date in thi conditions, or to send him a message the ate is wrong.

 

I tried to start a script but my knowledge is limited and i'm struggling with the operators and the message.

 

Thanks for your help,

This topic has been closed for replies.

1 reply

Participant
May 25, 2023

Nobody ? 😞

 

ok I'll try to explain further,

This is my idea, I need help, for example I don't know if we can use "if" with "var".

 

Maybe it's the wrong way to imagine this ?

 

Var Edate = event.value

Var Sdate = util.scand("dd/mm/yyyy", "request_date");

Var Eyear = year of "request_date"

 

If sdate is before 30/09

var Maxdate = 31/12/"Eyear"

If sdate is after 1/10

var Maxdate = 31/12/"Eyear+1"

 

If Event.value > Maxdate

app.alert("Error! You cannot put a date after the 31/12"&(year of Maxdate)""

 

Thanks for your help.

Inspiring
May 25, 2023

There are multiple posts about comparing dates, did you try search forum?

Do you want to hire someone to make the script for you?

Participant
May 26, 2023

Yes of course I searched the forum and everywhere else maybe not enough, but my problem is not comparing the dates, I just need a little help for how to think this script.

So we have to pay here for help ? I didn't know.

It's just acquiring knowledge but anyway I'll figure it out.