Skip to Content
0
Feb 23, 2011 at 11:10 AM

offline form - lock form when submit by email

66 Views

Hi Gurus,

Need your expert advice on this.

I am creating a offline form with a standard "Submit by email" button. After user filled in all the value, and clicked on the "submit by email" button, the standard validation will check for required fields and if everything is fine it will attached this pdf in an email.

The problem is i want the pdf that get attached in the email as readonly, and with the "submit by email" button hidden. Any idea how do i archive this?

I am thinking of using the below script to lock the fields:

for (var nPageCount = 0; nPageCount < xfa.host.numPages; nPageCount++)

{

var oFields = xfa.layout.pageContent(nPageCount, "field");

var nNodesLength = oFields.length;

for (var nNodeCount = 0; nNodeCount < nNodesLength; nNodeCount++)

{

oFields.item(nNodeCount).access = "readOnly";

}

}

But the problem is I can't find a suitable event to trigger it.

For example:

1. if i put at the "click" event of "submit by email" button, the fields will get lock even the empty field validation failed, as the click event is trigger before the validation.

2. If I put at the "presave" event, it locks the fields only after the empty fields validation is successfully done. But it will lock the fields when user trying to save the pdf doc, which i dont want.

Any idea will be very grateful.