Skip to main content
Participant
June 29, 2020
Question

Java Script to unhide a button?

  • June 29, 2020
  • 3 replies
  • 607 views

Is there a java script that can be written that would unhide a button based on a drop down box selection?

I am creating a form. On the form I have 4 names in a Drop Down box. I would like to know if there is a script that based on which name is selected will make a corresponding button appear or unhide? The button action will be to email the selected person the form when completed. Or is there an easier way to achieve this goal. Not a java writer so I am kinda stuck with the idea with no way to try.

I have attached the Form. The Drop Down I am Wanting to use to determine the Button to display is the SL Name Field. I have not generated the buttons yet to email the completed form. I was wanting to see if this was possible first. If not then I will simply add a "Send Email" button and have it email all 4 people in the Drop Down Box.

 

Thanks for any help in advance.

Brian Sheehan

This topic has been closed for replies.

3 replies

try67
Community Expert
Community Expert
June 30, 2020

Sure, that's possible.

As the custom validation script of the drop-down field enter something like this:

 

this.getField("EmailButton1").display = (event.value=="Brian Sheehan") ? display.visible : display.hidden;

 

Duplicate the line with different field names and values to do the same for other buttons.

I don't see those buttons in your file so I just used a generic field name. Adjust it as needed, of course.

 

B_SheehanAuthor
Participant
June 30, 2020

This is great. I really appreciate the help as I am not a "coder".....lol. I will try this when I get back to work tomorrw and let you know if it worked....no doubt it will if I don't mess up. Thank you.

B_SheehanAuthor
Participant
June 29, 2020

ADOBE Acrobat DC

John T Smith
Community Expert
Community Expert
June 29, 2020

Please post the exact name of the Adobe program you use so a Moderator may move this message to that forum