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

How to disable validation errors

victorcl
Registered: Jan 26 2010
Posts: 7

Hello .
I am using adobe livecycle 8.2 , I have some fields as required , but for a reason I keep getting

At least one required field was empty on export. Please fill in the required fields ( highlighted ) before continuing

and I need through javascript or formcalc . I need to disable this validation .. to skip it on a submit button .

I been tryng many ways with validation.nulltest = "disabled" and xfa.host.validationsEnabled = false; .. in many ways .. but I always get the " At least one required field ..... ""

is there a way to make a submit button skip all those validations ?? ...

Thanks.

Victor.

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Why not remove the "required" setting in the first place? If you want to disable it at run time then why do you need it?

But if you want to dynamically manipulate the required fields, the use the "mandatory" field property. For example, say I wanted to make a field required if a check box was selected

if(myCheck.rawValue)
myField.mandatory = "error";
else
myField.mandatory = "disabled";


Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

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

victorcl
Registered: Jan 26 2010
Posts: 7
Well I needed to skip the validation , because I already have another button that goes through a webservice and then after I needed to use a submit button to send a signature .

and I tried what you said .. but coulndt make it work neither U.u .. I dont know what I do wrong ... BUT .. I found this function that works great if anyone could use it.

just call it in a preSubmit and it skips all required fields :)

function defeatAllMandatoryFields() {
// The following code iterates through all of the object types that could be mandatory
// and forces them to non-mandatory
// Exclusion groups are intentionally not in the objectTypes array because they
// are not found in the layout DOM by calling the layout DOM pageContent() method.
objectTypes = new Array("subform", "field")
numberOfObjectTypes = objectTypes.length

// Iterate over all the object types that could be mandatory
for (var objectTypeIndex = 0; objectTypeIndex < numberOfObjectTypes; objectTypeIndex++) {
numberOfPages = xfa.host.numPages
objectType = objectTypes[objectTypeIndex]

// Iterate over all the pages
for (var pageIndex = 0; pageIndex < numberOfPages; pageIndex++) {
formObjects = xfa.layout.pageContent(pageIndex, objectType)
numberOfFormObjects = formObjects.length

// Iterate all the interactive objects retrieved from the page
for (var formObjectIndex = 0; formObjectIndex < numberOfFormObjects; formObjectIndex++) {
formObject = formObjects.item(formObjectIndex)

if (formObject.validate.nullTest != "disabled") {
formObject.validate.nullTest = "disabled"
}
if (formObject.parent.className == "exclGroup") {
if (formObject.parent.validate.nullTest != "disabled") {
formObject.parent.validate.nullTest = "disabled"
}
}
}
}
}
}

Thanks.