Expand my Community achievements bar.

simple js submit button query! - help!

Avatar

Level 1

Hi guys,

I have a 1 page livecycle pdf form which has fields and a submit button. When the form is submitted it sends the pdf to our server, saves it, attaches it to an email then emails it..

I have an issue where the form is being sent via email and the submit button is still clickable.

This is the code I have on the 'mousedown' of the form

[code]

if

(form1.execValidate() )

{

// 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

= "readOnly";

}

}

Button4.presence

= "hidden";

}

[/code]

what I need to avoid is, if a user doesnt enter a mandatory field it locks the whole form making it impossible to send again!

Is there a simple way to once the button is clicked (and all mandatory fields populated) the forms buttons will be disabled on the version received on email?

thanks for looking guys

hope someone can help!

0 Replies