Hello,
i've got a problem that drive me crazy.
In a XML-form I use a JS by thomp, that I found in a tutorial.
The JS works in the calculate event of a textfield in flowtext to output the expire-date of this form.
To avoid that the JS will be calculated everytime the filled form is opened again I used an IF-condition for it.
if (Formular1.Seite1.Body.Dienstleitungen.EndDatum.rawValue == null)
{
// Get todays date
var RightNow = new Date();
// Calculate todays Milliseconds
var msRightNow = RightNow.getTime();
// Calculate 7 days in Milliseconds
var sevenDays = 7 * 24 * 60 * 60 * 1000;
// Calculate final date
var finalTime = msRightNow + sevenDays;
// Convert to date
var theNewDate = new Date(finalTime);
// Output the final date
event.value = util.printd("dd.mm.yyyy",theNewDate);
}
else
{}
In the preview of Designer this works perfectly and also in Acrobat/Reader.
But I have to enabe User Rights for the form, that causes a dilemma I could not solve until now.
After enabling the rights and saving the form, the IF-condition is never NULL again and there is always an expire-date in the form that has been calculated before enabling the rights.
I have a reset-all-button in the form with that I can force the form to calculate a new expire-date, but that's no a end user friendly solution to say: "Please reset the form after opening even if it is blank".
So I need a solution.
Please help!
I'm just now learning this scripting thing, but I've noticed that the code seems to execute in the order it reads it.
Just throwing out an idea...
Jenn D.