Quantcast
Channel: Adobe Community : Discussion List - LiveCycle Forms
Viewing all articles
Browse latest Browse all 1160

required fields with 'read only' on email submit.

$
0
0

Hi folks.

 

My hope is to lock fields down to read only when the required fields have had data entered.  These are both text fields and radio buttons.


I currently have my fields set to user entered required on my form and an email submit set to submit as PDF.

 

attached to my Email submit button is this;

form1.#subform[0].EmailSubmitButton1::postSubmit:form - (JavaScript, client)

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

}

}

 

Previewing my form;

Clicking submit without entering data to required fields will highlight those fields as expected but it also locks all fields down to read only, not allowing the user to enter data in to the required highlighted fields.

 

I've done some research but got nowhere fast.  My thinking was, if the fields don't validate then don't run the above script else run the script and submit as PDF.

 

I've little knowledge of scripting but I am keen to learn and will do.  I don't understand the language but do have an idea of how its structured.   I done a fair bit of basic programming maybe 10 years ago but its vague.

 

Help is very much appreciated.


Viewing all articles
Browse latest Browse all 1160

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>