Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Having trouble disabling fields form in LiveCycle 8.1.2


Level 1

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( == 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
3 Replies


Not applicable
send me your form



Level 1
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.


Level 1
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.