cancel
Showing results for 
Search instead for 
Did you mean: 

adobe date format

Former Member
0 Kudos

Hi

i have binded an atrribute of type date to date/time field (DD-MMM-YYYY) .if user enters any other formats like 1234,or an invalid date,then he click on submit button, error msg is displaying saying that "Enter the value in the format 1987- 11-25." instead of 25-NOV-1987 .please can u send the date validation code .

Thanks

kishore

Edited by: kishore shikore on Dec 5, 2008 10:40 AM

Edited by: kishore shikore on Dec 5, 2008 10:41 AM

Edited by: kishore shikore on Dec 5, 2008 10:42 AM

Edited by: kishore shikore on Dec 5, 2008 10:42 AM

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

thanx

Former Member
0 Kudos

Thats right Chintan.

Here, by specified date I meant the format you want the date. i.e: DD-MM-YYYY or MM-DD-YYYY etc.

It's just an example.

Former Member
0 Kudos

hi vishal

even i have specified format DD-MMM-YYYY its not working can u once try it and tell me..

Thanks

Kishore

Edited by: kishore shikore on Dec 9, 2008 1:58 PM

Former Member
0 Kudos

Hi Kishore -

I just gave a sample script.

if (data.subform1.DATE.format != 'specified format')

then

xfa.host.messageBox("Please enter DATE in YYYY-MM-DD format only")

endif

You should write your subform etc where you have declared DATE field. Similarly, you should also specify your desired format.

I hope it helps.

Former Member
0 Kudos

Hi vishal

Thanks for your reply,if condition send by you is not working data.subform1.DATE.format != 'specified format',can u look into this try to tel me where the problem is.

Thnks

Kishore

Edited by: kishore shikore on Dec 9, 2008 8:11 AM

chintan_virani
Active Contributor
0 Kudos

Kishore,

The "specified format" has to be replaced with the format you have i.e DD-MM-YYYY.

Chintan

Former Member
0 Kudos

Hi -

Try this. May be it would help.

You can write formcalc script on DATE field in 'preSubmit' event to validate the specified format and a message to pop up.

FormCalc script -

if (data.subform1.DATE.format != 'specified format')

then

xfa.host.messageBox("Please enter DATE in YYYY-MM-DD format only")

endif

As you have already specified the DATE format in paletts -> objects -> bindings, it will not accept any other format entered. The above script will let a message to pop up displaying the same.

Former Member
0 Kudos

Hi vishal,

Thanks for your response can you please explain if (data.subform1.DATE.format != 'specified format') when iam trying to write code send by you iam not able to get subform1 after data can you please explain me.

Thnaks

kishore