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

JavaScript coding for activating a checkmark box

Community Beginner ,
Mar 22, 2020 Mar 22, 2020

Good day, I've been scratching my head for a while now into finding a JavaScript code for this project of mine. I have a PDF form that I created with very interactive components within. I have a lot of buttons which carry extra information for the users. However, I'm trying to create a JavaScript to put at the beginning of the document entry that would automatically simulate a checkmark into an hidden box (I named it English) because that box will trigger a series of hide and show for other buttons, but I want that checkmark button to be automatically activate at entry without people knowing (the reason why I hide the box to be triggered). I've tried every which way to do this and the most I get is a checkmark in the box without the box actually doing the hide/show function it was made for. Does anybody know the exact coding I should use for this?

Here's what I got so far, and that does the trick to put the checkmark in the existing box named English, but it doesn't make the checkmark box do its mouse up function I assigned to it which is to hide multiple buttons (I got 46).

this.getField("English").checkThisBox(0,event.target.value = "On");

3.9K
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 Beginner ,
Mar 22, 2020 Mar 22, 2020

Darn!   Is there a way to create a different menu  that would do the same thing but which may be bigger?

 

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 ,
Mar 22, 2020 Mar 22, 2020

I guess you can use a Dialog object, but that would be much more complicated and I don't think it will look any better.

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 Beginner ,
Mar 22, 2020 Mar 22, 2020

Ok, then I guess I'll have to do with what I got 😉  I thank you so very much for all your help with this.  And I agree with your previous reply to shorten the script, I'll give that a try, this way I just have to write the names once.

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 ,
Mar 24, 2020 Mar 24, 2020
LATEST

The reason I used popUpMenuEx instead of popUpMenu is that it allows you to return a different value then the one displayed to the user (using the cReturn parameter). So you can display "Français" but return "French", which is what you used in the names of your fields and layers. There's no need to use both, of course.

 

[I've stopped replying to replies because they disappear without warning at a certain point, and also because the nesting system is terrible. I recommend you only reply to the original question from now on.]

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