Expand my Community achievements bar.

onChange event for checkboxes.

Avatar

Level 9

Hi all ,

       I got a table , where in the 1st row of the table there is a CheckBox.Below that there are two columns.If the user clicks the checkbox then the columns below that checkboxes should become required at the runtime.I have tried the onchange event for the check box ; it throws some error and even some weird kind of errors come when I use the onClick event . I got confused , if the user checks and unchecks the checkbox for the 1st time then notthing has occured but when the user does for it for the 2nd time then it shows those fields as required , out of curiosity i also changed the condition for the onClick event but the same result is coming against the normal values.

For onChange event :

form1.Subform0.Subform1.Subform9.Subform10.Table48.Row2.CostItemRecovered_OnlyEnergyCharges::change - (JavaScript, client)

  var newVal = this.boundItem(xfa.event.newText);
if(newVal == 0)
  {
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.Purchasecost3_1").validate.nullTest = "disabled";
   }
  else
    {
     xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.Purchasecost3_1").validate.nullTest = "error";
     }

  For onClick event :

form1.Subform0.Subform1.Subform9.Subform10.Table48.Row2.CostItemRecovered_OnlyEnergyCharges::click - (JavaScript, client)
var a = xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row2.CostItemRecovered_OnlyEnergyCharges").rawValue;

if(a == 1)
  {
    xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_L1_1").validate.nullTest = "error";
   }
  if(a == 0)
    {
      xfa.resolveNode("form1.Subform0.Subform1.Subform9.Subform10.Table48.Row4.ComplianceCheck_L1_1").validate.nullTest = "disabled";
     }

         I am totally confused . Please help.

1 Reply

Avatar

Level 10

Could post your form so I can have a look at it.

Steps to upload the document

1) goto acrobat.com website
2) login with your Adobe login/password.
3) In Actions you will find Upload. Select your form and upload.
4) After uploading, select form name in All Files section and right click and select share.
5) Check the checkbox "Allow anyone with a link to view this document".
6) Copy the URL link and post it in the forum.

Thanks

Srini