Quantcast
Channel: Adobe Community : Discussion List - LiveCycle Forms
Viewing all articles
Browse latest Browse all 1160

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

$
0
0

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


Viewing all articles
Browse latest Browse all 1160

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>