Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Problem about date display pattern & preSave event validate

Avatar

Level 2

Hi, I'm newbies in Livecycle Designer. So I have some problem about my work

1. I used date field to store date data and my client want to see year format in Buddhist Era (B.E.).For example, date data is

22/09/2009("DD/MM/YYYY") and they want to see 22/09/2552 (2552 is year of Buddhist Era).I try to do it and have the best way to do is change     display pattern to date{DD/MM/g YYYY}  , it's automate display to 22/09/B.E. 2552.

     However I would like to know. Have anyone has another way to guide me? My client consists that they want to see 22/09/2552 only

(not show B.E.). Please advices me.

2. I write some script to validated form in preSave event. My purposes is a form can't be save if the form failed validatation. However, when form failed validatation. It have popup validated message, but a form have continue to save. Please let me knows how to do this

Thankyou for all comment.

Best Regard,

7 Replies

Avatar

Level 2

Sorry for answer so late. I have some hoilday weekend.

Here is an example PDF, I write some script to vaildate this form. If you want more information, please let me know.


Finally, Thankyou for your kind to help me.

Regards,

Avatar

Level 10

Ok I have had a look at this and I have found that you cannot display that date style without the B.E. (through a pattern anyways)  If we did that there would be no way to know what style was being referenced.

Regarding your second question about cancelling the submit you will need to add the comnmand:

xfa.event.cancelAction = true;

This will need to be on the preSave event and will cancel the Save.

If you look in the help under cancel Action you will see the description of this topic.

Paul

Avatar

Level 2

Hi Paul,

I greatful that you help me. Thankyou very much.

For my first question. In my country, we have common to know this pattern and in ours goverment have used this pattern in standard. So for display date pattern, we dont want to see B.E. because we have to know this pattern in public already.

My point is how can I see this pattern without display B.E.?

The second question, that very usefull to me. But when I try this code, It still can be saved.

This is my javascript code in preSave event.

if(DecimalField1.rawValue != DecimalField2.rawValue)
{
    xfa.host.messageBox("Value not match. Validate Fail", "Validate Fail",0,0); 

    xfa.event.cancelAction = true;
}

Is any this code have somthing wrong? .Please give me some suggestion.

Best Regards,

Mai

Avatar

Level 10

For your 1st question I understand what you are saying but I do not believe there is a pattern that you can use that will not have the B.E. in it. Having the g in the pattern indicates that you want to use an alternate calendar and th eproduct will indicate which one by adding the designation. Without the g you woudl be using the default calendar.

For the 2nd issue it doesn't look like you can do it. I found this post that describes it:

http://forums.adobe.com/message/2022336#2022336

The technique you are using is correct but I think that they stopped the cancelling of the Save for some reason that I do not know.

Paul

Avatar

Level 2

Ahhh, that give me many trouble to fighting the users.

Anyway, thankyou for you help and suggestion

Best Regards,

Mai