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

required fields

designer525
Registered: Oct 4 2011
Posts: 4

I have code that makes a field required which is what i want but my error message will read
"Please provide a name. cannot be left black"
 
I just want the error message to say Please provide a name.
 
if (this.rawValue == null || this.rawValue == "")
{
this.validate.nullTest = "error";
this.assist.toolTip.value = "Please provide a email.";
xfa.layout.relayout();
}

Danielle

My Product Information:
LiveCycle Designer, Windows
radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Hi,

use this script in the exit:Event of the field:
  1. if (this.rawValue === null || this.rawValue === "") {
  2. this.assist.toolTip.value = "Please provide an email.";
  3. xfa.host.setFocus(this);
  4. } else {
  5. this.assist.toolTip.value = "You entered an email";
  6. }

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

designer525
Registered: Oct 4 2011
Posts: 4
I need it to prevent customers from printing before filling out all required fields that code that I gave was in prePrint.

Danielle

radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
Then you should use the method described in this article
"http://forms.stefcameron.com/2008/04/13/prevent-printing-pdf-forms-in-acrobat-8/

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

designer525
Registered: Oct 4 2011
Posts: 4
With that XML source how does it know what fields to validate?

Danielle

radzmar
Expert
Registered: Nov 3 2008
Posts: 1202
The validate object checks all mandatory fields you defined in the template.
If any of those fields is empty the validation fails and the action (printing or submitting) is aborted.

radzmar
LoveCycle Blog
Documents you need:
LiveCycle Designer ES2 Docs

designer525
Registered: Oct 4 2011
Posts: 4
I dont want the fields to be required under the value tab I want to make them required through script because i dont want that red border.

Danielle