Having trouble disabling fields form in LiveCycle 8.1.2




I have been working with live cycle for 3 weeks now and I need to edit a form to be dynamic so that a user can select a check box and certain fields are available depending on what's selected.

ex: is user checks oper_bird than txt field oper_secur_id is available to be written in.

I have set the fields to "readOnly" initially and I am now having problems with JavaScript to disable the fields.

I have read the documentation on the differences between AcroJS and XFA and I am still confused. The form is set to dynamic and

Heres the code I'm trying to get to work (I am using it on a radio button to enable or disable a txt field for testing):

// Function to enable form fields

function EnableField(cFieldName)


// First acquire the field to be enabled

//var oFld = xfa.form.F.resolveNode("$.." + cFieldName)

//if(event.target.rawVaule == 1)//oFld)

//{ // Next acquire the hidden field with the normal colors


//var oNmlFld = xfa.form.F.resolveNode("$..NormalColorsFld")


//{ // Make field interactive

$oFld.access = "open";

// Restore Normal Colors

$oFld.fillColor = oNmlFld.fillColor;

$oFld.borderColor = oNmlFld.borderColor;

$oFld.fontColor = oNmlFld.fontColor;


// }


// Function to disable form fields

function DisableField(cFieldName)


// First acquire the field to be disabled

var oFld = xfa.form.F.resolveNode("$.." + cFieldName)


{ // Make field Read- Only

oFld.access = "readOnly";

// Set Grayed out colors

oFld.fillColor = "192, 192, 192";

oFld.borderColor = "171, 171, 171";

oFld.fontColor = "125, 125, 125";



I removed some of the conditionals to see if the events were happening. The code is in "Init" and the functions are called respectively in the "mouseUp" for "enable" and "disable"

Thanks for the Help





Okay, heres where the problem stands now:

I disabled the fields, made them "readonly", however I can not reactivate the Fields to bring them back into a "User Entered - ..." value after setting them to "readonly". I know I am getting the calculation script to work because I am changing the colors of the field depending upon input.

WorkflowUser could you you still want to take a look at the script? if you want to of course.

Thanks again.



sorry forgot the code:

if (Full_Check.rawValue == 1){

//hightlight field for user.

this.fillColor = "255, 255, 0";}

//make open for input here.

/.....code here.../

else {

this.fillColor = "255, 255, 255";}


this is the script I am using. It's a simple color change. The field is set to readOnly on init however I want to make the field open for input.