Highlighted

Button to Convert from Dynamic to Static form Attach to Email then Convert Back

Avatar

Guest

12-03-2009

I have this working, but only on reader 9. What I need is a different way to accomplish this. The scenario is I have a dynamic form that we fill out for a customer. We want to email it to a customer, but we don't want them to have access to our calculations.



So I want a button that turns the dynamic form into a static form than attach the static PDF to an email, than I want it to change back to dynamic on the original.



This works in acrobat reader 9, but not in reader 7.



my code for the submit button is this



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 = "readonly";

}

}



that code works fine in acrobat reader 7 and later, the problem comes in when I switch it back to dynamic with this code in the postsubmit event



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 = "open";

}

}



This nets me an error on opening the form in any reader previous to reader 9:



Invalid enumerated value:postSubmit



Anyone have any ideas?



If there is a way to do this in formcalc I would rather do it that way, because there are a few fields I'd like to hide before the customer gets it as well.



Thanks