Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Populate checkbox with button click - need help with script

Engaged ,
Oct 17, 2019 Oct 17, 2019

I found the following JavaScript on JSFiddle for what I need to do, but I don’t know how to apply it to my PDF document to make it work.  Could one of you super amazing brilliant genius javaScript experts help me with this?

 

$(function() {

  $("button").on("click",function() {

    $("input[value='mercedes']").prop("checked",true);

  });

});

 

I would like to be able to populate a checkbox when the Click Me button is clicked.  I need the user to be able to click on the button to add more attachments without making the button disappear, and the user will need to be able to manually uncheck the box.

 

FileAttached.PNGexpand image

 

2.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
1 ACCEPTED SOLUTION
Community Expert ,
Oct 17, 2019 Oct 17, 2019
On mouse click you can use: this.getField("Check Box2").value = "Yes";

View solution in original post

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 17, 2019 Oct 17, 2019

This is code for web browsers.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 17, 2019 Oct 17, 2019
Oh, that's the closest thing I could find for what I need. Would you happen to have a resource that could help me figure out how I could do this? It's important I figure out and I'm totally lost with how to do this. The only other thing I could find was a script for a radio button, but I need it for an Add Button https://answers.acrobatusers.com/Is-it-possible-to-use-javascript-to-have-a-check-box-checked-if-a-r...
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 17, 2019 Oct 17, 2019
I tried adding the following custom calculation script in a hidden text field, but it didn't work
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 17, 2019 Oct 17, 2019
var btn = this.getField("Button1").value; if (btn == "Button1") { this.getField("Check Box2").value = "Yes"; } else {
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 17, 2019 Oct 17, 2019
On mouse click you can use: this.getField("Check Box2").value = "Yes";
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Oct 17, 2019 Oct 17, 2019
LATEST
YES!!!!!! I'm am so happy!!! Thank you so much, I'm so grateful. You are super amazing, brilliant and genious!! X0
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines