cancel
Showing results for 
Search instead for 
Did you mean: 

Preallocate the actual date

Former Member
0 Kudos

Hi community,

I would like to preallocate the actual date in the "Initialize"-event.

Format/Pattern: dd.mm.yyyy (05.01.2011)

But I get always a popup with the warning "DATEFROM check failed"?

Afterward I click OK and the date is correct in my DATEFROM-Field.

Why the warning?

Best regards,

Chris

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Chris,

Have you done the coding to pre-allocate date in the initialize event of the date field? Can you please share the script?

Thanks & Regards,

Sanoosh

Former Member
0 Kudos

I solved it.

The format has to be like this: 2011-01-05

But I don't know why.

var date= new Date();

var dd = date.getDate();

var mm = date.getMonth() + 1;

var yy = date.getYear()-100+2000;

if (dd < 10){

dd = "0" + dd;

}

if (mm < 10){

mm = "0" + mm;

}

this.rawValue = yy + "-" + mm + "-" + dd;

best greets

Chris

Former Member
0 Kudos

Hi Chris,

If your requirement was to get the current date, the script is not required. In the Library palette --> Custom, there is a field called 'Current Date'. Just drag and drop the field into the form and set the desired pattern.

Thanks & Regards,

Sanoosh