Hiding Objects based on drop down selection

b_riden

14-09-2015

Hey guys,

     I'm hoping someone here can help me. I've been browsing forums and tried multiple options, but can't get anything to work.

This is what I have set up:

  • Drop Down list with the following options:
    • All (value 1)
    • Specific (value 2)
    • Range (value 3)
  • Two different text boxes (one named Range and the other named Specific)

What I'm trying to accomplish:

Based on the drop down selection, the boxes should either be visible or hidden:

  • All (value 1) ; both boxes are hidden
  • Specific (value 2) ; the Specific box is visible, but the Range box is hidden
  • Range (value 3) ; the Range box is visible, but the Specific box is hidden

No matter what I try (both JavaScript and FormCalc) I can't get this to work. If I start with the text boxes hidden they won't appear visible, and when they start visible they won't hide. I'm pulling my hair out on this one. Any help would be greatly appreciated.

Accepted Solutions (1)

Accepted Solutions (1)

Magus069

MVP

14-09-2015

The error is not within your code, it is within the form itself...

Within LiveCycle Designer, you have form properties which will design the PDF on how it will react

You form is set to be a Static PDF and a lot of functionalities are disabled within Static PDFs


To change your form from static to dynamic, follow the instructions:

Hope this will help ya!

Answers (5)

Answers (5)

b_riden

14-09-2015

I've been using other code and just editing where I know to edit. I'm not sure how to do the catch statement or the return value check.

Attached is my form. I had to edit the information out for the most part because of the sensitivity of the document.

http://s000.tinyupload.com/?file_id=00155514796826374746

**Sorry for the tiny upload link. I couldn't see how to attach a document here.

Magus069

MVP

14-09-2015

It should be working fine by looking at this quickly... I don't see anything that wouldn't make it work...

Try using the try catch statement to see if any error occurs,

Otherwise use a message box to see what xfa.even.newText is returning as a value

If none of these work, would you share your form so I can take a look at it?

b_riden

14-09-2015

The current code I'm trying to get to work (I've tried multiple):

InternalHosts is the drop down. Box, Specific, and Range are the three items I'm trying to hide depending on the selection

Capture2.PNG