cancel
Showing results for 
Search instead for 
Did you mean: 

How to disable the check boxes based on user selection in offline forms using Javascript

Former Member
0 Kudos

Hi All,

Actually I am working on Offline Interactive adobe forms. In one of my requirement I have 16 check boxes in the form and User can select only 3 check boxes among 16  check boxes. If User cal select 3 check boxes the remaining 13 check boxes are go to readonly mode.

For this requirement I written below javascript for all check boxes in click event but it not working. If possible could you please provide the Javascript code for this req..

var counter = 0;

  if(CheckBox1.rawValue == "1")

  counter++;

  if(CheckBox2.rawValue == "1")

  counter++;

  if(CheckBox3.rawValue == "1")

  counter++;

  if(CheckBox4.rawValue == "1")

  counter++;

  if(CheckBox5[0].rawValue == "1")

  counter++;

  if(CheckBox6.rawValue == "1")

  counter++;

  if(CheckBox5[1].rawValue == "1")

  counter++;

  if(CheckBox5[2].rawValue == "1")

  counter++;

  if(CheckBox5[3].rawValue == "1")

  counter++;

  if(CheckBox5[4].rawValue == "1")

  counter++;

  if(CheckBox5[5].rawValue == "1")

  counter++;

  if(CheckBox5[6].rawValue == "1")

  counter++;

  if(CheckBox5[7].rawValue == "1")

  counter++;

  if(CheckBox5[8].rawValue == "1")

  counter++;

  if(CheckBox5[9].rawValue == "1")

  counter++;

  if(CheckBox5[10].rawValue == "1")

  counter++;

  if(counter > 3)

  {

  xfa.host.messageBox("You can select only Three");

  CheckBox5[10].access = "readOnly";

  }

Thanks,

Ravi.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Issue resolved using the above code only.

Answers (0)