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