Avatar

Level 2

Thanks to you both for your help. Srini,my limited knowledge makes it hard for me to exactly follow your script - would I put this on the Print button or another button? Does it include the command to print if all required fields are filled in?

Paul, I think yours was a little easier to follow. It seemed to work, but something weird is happening (probably from the original script for making the text field mandatory from the checkbox). Let me outline my sample form and provide the script and tell you the weird thing:

Checkbox (named Multiple)

TextField (named ListNames)

TextField (named Other - made this one a required field)

Button (named Fake - on top of the Print button)

Print Button (named Print)

The script on Multiple is:

if

(this.rawValue == 1){ListNames.mandatory = "error";}

else

{ListNames.mandatory = "disabled";}

true;

The script on Fake is:

if

(form1.execValidate() == false){

app.alert("You have not filled out all of the required fields....") } else {

xfa.host.print(1, "0", (xfa.host.numPages -1).toString(), 0, 0, 0, 0, 0);

ListNames.validate.nullTest = "error";

}

When I test it out without the Multiple checked and data in Other, it goes to the print dialogue box (yea!) but then a red border appears around the ListNames box. Otherwise, all testing is good.