I'm getting an "Invalid enumerated value: postSubmit" error in line 2706 of my form. The post submit script is designed to unprotect specific fields on the form so the user can submit multiple requests using the same header information.
This ran fine when I wrote and tested it, but today it has decided not to work. Any ideas?
Script follows (written in LiveCycle Designer 8.2)...
ReferralRequestForm.ReferralRequestPage1.Button1::postSubmit:form - (JavaScript, client)
// Provide option to reopen the form for further requests regarding the same patient.
// Verify submission
var cMsg = "Do you want to submit another request for this patient? \n\n"
cMsg += "Select YES to CLEAR and UNLOCK the requested services fields for new entries.\n\n"
cMsg += "Do you want to Continue?\n\n"
var nRtn = app.alert(cMsg,1,2, "Unlock Form?");
if(nRtn == 4) { // A Yes Answer
// Unlock specific fields in the Requested Services and Clinical Information section
ClinicalInformation.RequestedServices.access = "open";
ClinicalInformation.RequestedProvider.access = "open";
ClinicalInformation.SupportingDiagnoses.access = "open";
ClinicalInformation.ClinicalInformation.access = "open";
ClinicalInformation.DiscussedWith.MedicalDirector.access = "open";
ClinicalInformation.DiscussedWith.PC.access = "open";
ClinicalInformation.DiscussedWith.RpFamily.access = "open";
ClinicalInformation.CarePriority.access = "open";
// Clear content of unlocked fields
ClinicalInformation.RequestedServices.rawValue = null;
ClinicalInformation.RequestedProvider.rawValue = null;
ClinicalInformation.SupportingDiagnoses.rawValue = null;
ClinicalInformation.ClinicalInformation.rawValue = null;
ClinicalInformation.DiscussedWith.MedicalDirector.rawValue = 0;
ClinicalInformation.DiscussedWith.PC.rawValue = 0;
ClinicalInformation.DiscussedWith.RpFamily.rawValue = 0;
ClinicalInformation.CarePriority.rawValue = "Routine";
// Unlock Submit button
this.access = "open";
}
endif; // alert "Yes"
ReferralRequestForm.ReferralRequestPage1.Button1::preSubmit:form - (JavaScript, client)
// Validate before continuing
if (ReferralRequestForm.execValidate() == true) {
// Verify submission
var cMsg = "Are you sure you are ready to submit this form? \n\n"
cMsg += "Select YES to LOCK the form and generate the email.\n\n"
cMsg += "Do you want to Continue?\n\n"
var nRtn = app.alert(cMsg,1,2, "Lock Form?");
if(nRtn == 4)
{ // A Yes Answer
// Get the field containers from each page.
for (var nPageCount = 0; nPageCount < xfa.host.numPages; nPageCount++) {
var oFields = xfa.layout.pageContent(nPageCount, "field");
var nNodesLength = oFields.length;
// Set the field property.
for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++) {
oFields.item(nNodeCount).access = "protected";
}
}
// Specify email subject line
var eAddress = "my [dot] name [at] company [dot] com";
switch (ReferralInformation.Setting.rawValue) {
case "Long-Term Care":
eAddress = "umltc [at] company [dot] com";
break;
case "Assisted Living":
eAddress = "umal [at] company [dot] com";
break;
default:
eAddress = "my [dot] name [at] company [dot] com";
break;
} // end eAddress switch
this.resolveNode("#event").submit.target = "mailto:" + eAddress + "?&subject=Routine/Specialty Referral, MemberID: "
+ ReferralInformation.MemberID.rawValue;
}
endif; // alert "Yes"
}
endif; // form validates
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/]http://www.adobe.com/devnet/acrobat/[/url]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script