Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Having trouble disabling fields form in LiveCycle 8.1.2

Avatar

Level 1
Hello,



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

popup()

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

//if(oNmlFld)

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

if(oFld)

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

Avatar

Former Community Member
send me your form

girish

mergeandfuse@gmail.com

Avatar

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.

Avatar

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.rawValue;



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.