Copy link to clipboard
Copied
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");
Copy link to clipboard
Copied
Darn! Is there a way to create a different menu that would do the same thing but which may be bigger?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.]
Find more inspiration, events, and resources on the new Adobe Community
Explore Now