These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Disable Validation on Hidden Date Field

publicdebter
Registered: Feb 20 2008
Posts: 18

Hello,
 
I have two subforms. When one is selected, the other remains hidden, and vice-versa.
 
On each subform, there is a date field with pre-existing text in the field which says "Click for calendar-->". Kind of like a tool tip.
 
When the user click in this field, I have it scripted so this text disappears, and the calendar pops up.
 
However, when the user attempts to e-mail the form, the date field in the hidden subform registers as invalid, as the pre-existing text is still there.
 
Is there a way to override or disable the validation of the other date field?
 
Or is there script to make the text in the other date field disappear simultaneously the user clicks in the active date field?
 
Your help is appreciated!
 

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
I assume that by "email" you mean "submit by email"? So the validation message is the result of the submit action?

Have you set any formatting, validation, or required parameters for the date fields? What event scripts are you using on the date fields? Are you sure its the date field that is displaying the message? What is the exact wording?

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

publicdebter
Registered: Feb 20 2008
Posts: 18
Hello,

Yes, the validation message is the result of the "submit by email" action.

Yes, I have set parameters for the date fields:

The data format is "date"
The validation pattern is "date.default{}"
And I have a validation pattern error message which says "Selection from calendar required." So I know it is the date field displaying the message.

The pre-existing tool tip text is "Click for calendar-->"Here is the javascript I have entered:

if (this.rawValue == "Click for calendar-->")
{
this.rawValue = null;
}

if (this.rawValue == null)
{
this.rawValue = "Click for calendar-->";
}

Thanks!

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
On what event is the script? BTW, the script is self defeating. I don't think you need the script at all since the calendar popup will fill in the field when a selection is made.

But the problem is that the field is setup for validation. I'd suggest using a script to set the relevant properties dynamically at the same time the date field is made visible/invisible. I'm sure what the exact property is, you'd have to do some experimentation. But a good place to start is to remove all the parameters you've applied to the field, then add them back one at a time until you see the validation error again. Also look at the field properties in the XML view.

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script