Skip to main content
January 19, 2017
Answered

Javascript for checkboxes ticked off = "good to go" text/sign

  • January 19, 2017
  • 1 reply
  • 481 views

Hi all,

I've seen allot of good asnwers here, so i hope you can help me.

Im looking for a Javascript that i can put in to a text field or simular.

I have to roughs off checkboxes in my PDF. (Im using Acrobat XI Pro)

One rough is with 7 "Yes" radio buttons and the other rough with 7 "no" radio buttons.

Im using radio buttons, because i only want them to be able to tick of either yes or no.

When all the "Yes" buttons has been ticked off - i would like a text to come up = You're good to go!

Will someody be helpfull with this ?

THX in advance, best regards, Kenneth.

This topic has been closed for replies.
Correct answer try67

Why are you using the Mouse Up event? As I wrote, it should be used as the

custom Calculation script.

On Thu, Jan 19, 2017 at 1:28 PM, LaVidaLoca27 <forums_noreply@adobe.com>

1 reply

try67
Community Expert
Community Expert
January 19, 2017

By "rough" do you mean "row"?

At any rate, you can use this code as the custom calculation script of your text field:

if (this.getField("radio1").value=="Yes" && this.getField("radio2").value=="Yes" && this.getField("radio3").value=="Yes" &&

    this.getField("radio4").value=="Yes" && this.getField("radio5").value=="Yes" && this.getField("radio6").value=="Yes" &&

    this.getField("radio7").value=="Yes") {

          event.value = "You're good to go!";

} else event.value = "";

You'll probably need to adjust the field-names in the code above to match the actual ones in your file...

January 19, 2017

Yes - sorry - i mean row (not writing english fluent).

THX for answer - but doesn't work yet :

I've now put the javascript in to the text field - "mouse up" and "run a javascript" and insert your code.

But it's not working - the text field doesn't show "you're good to go" when all Yes boxes is ticked of.

I've renamed all the "radio buttons" in the code to the names i've given them : "Yes1", "Yes2", "Yes3" and so on. They are in groups ith "No1", "No2", "No3" and so on. Is that the problem ?

Or is there something else i've have to do than what i've described i've done ?

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
January 19, 2017

Why are you using the Mouse Up event? As I wrote, it should be used as the

custom Calculation script.

On Thu, Jan 19, 2017 at 1:28 PM, LaVidaLoca27 <forums_noreply@adobe.com>