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

How can I automically deselect a checkbox once the maximum number of checkboxes have been selected?

Avatar

Level 1

I found a script below online that works supposedly well. I just need to know how I can get this code to work in livecycle on my pdf form as I am a novice in coding. If someone can attach an example in pdf form that would be great. Thanks!

<SCRIPT LANGUAGE="javascript">
  
function KeepCount() {

var NewCount = 0

if (document.joe.dog.checked)
{NewCount = NewCount + 1}

if (document.joe.cat.checked)
{NewCount = NewCount + 1}

if (document.joe.pig.checked)
{NewCount = NewCount + 1}

if (document.joe.ferret.checked)
{NewCount = NewCount + 1}

if (document.joe.hampster.checked)
{NewCount = NewCount + 1}

  if (NewCount == 3)
{
alert('Pick Just Two Please')
document.joe; return false;
}
}
  </SCRIPT> 


I got this code from here: Checkboxes: Only Two

0 Replies