Skip navigation
Currently Being Moderated

selection from drop down list makes field visible

Jun 29, 2012 11:38 AM

I have two drop down fields, the select in the first drop down field provides the list of items in the second drop down list. When an item in the second drop down list is selected, I want a hidden field to become visible.

 

I'm not sure how to write the script on the second drop down list to make the field visible. Here's the script I have, that's not working:

 

 

if (this.rawValue == "ACD");

 

{

agentID.presence = "visible";

}

if (this.rawValue == "Agent");

{

 

 

 

 

 

 

     agentID.presence = "hidden";

 

}

 

 

 

Thanks,

M.Dawn

 
Replies
  • Currently Being Moderated
    Jul 2, 2012 1:01 AM   in reply to mdawn50

    Hi Margaret,

     

    Which event have you used for the script? I would recommend the exit event of the second dropdown.

     

    The script looks okay, but just make sure that the second dropdown has .rawValues of "ACD" and "Agent".

     

    Also check the relative reference from the second dropdown to the agentID object. This may be full enough if they are separated by subforms.

     

    Make sure the form is saved as a Dynamic XML Form in the save-as dialog.

     

    Lastly, are there any errors in the JavaScript Console (Control+J when previewing), which would indicate a problem when interacting with the second dropdown?

     

    Niall

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 2, 2012 10:14 AM   in reply to mdawn50

    Hi Margaret,

     

    If you upload your form to a file sharing site; publish it; and then post the published link here. I will look at it when I get a chance.

     

    Niall

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 2, 2012 12:08 PM   in reply to mdawn50

    Hi Margaret,

     

    It isn't published. You need to follow the steps below:

     

    Acrobat.com publish.png

     

    Niall

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 2, 2012 12:42 PM   in reply to mdawn50
    • If you log back into Acrobat.com;
    • Select the file;
    • Either from the Share File menu at the bottom left, OR the dropdown menu from the file name, Click Publish;
    • Click OK through all the dialogs;
    • This will publish the form and make it available to anyone who clicks on the link above.

     

    Good luck,

     

    Niall

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 2, 2012 1:26 PM   in reply to mdawn50

    Hi Margaret,

     

    Here is the corrected form https://acrobat.com/#d=D3yZytcriTw0pMp4S232Wg.

     

    You had semi colons after the if statement (which was throwing it). Also I shortened the reference to the agentID object:

     

    if (this.rawValue == "ACD") {
        agentID.presence = "visible";
    } 
    else if (this.rawValue == "Agents") {
        agentID.presence = "hidden"; 
    }
    

     

    Good luck,

     

    Niall

     
    |
    Mark as:
  • Currently Being Moderated
    Jul 25, 2013 8:35 AM   in reply to Niall O\'Donovan

    I have a question.

     

    Why does the else check for the alternative value of Agents?

     

    The reason I ask is I have a similar problem with many alternatives in the dropdown.

     

    In the case of "OTHER" being selected I need other fields to be visible.

     

    In all other cases the fields in question should be invisible.

     

    If the dropdown value is OTHER the fields 1a-4a should be invisible.

     

    Why are we concerned with the value being something else?

     

     

    I guess what I need is a statement that says if the value is not equal to "OTHER" then those fields are invisible.

     

    I am trying this but I am not quite there:

     

    In the change event of the 2nd dropdown.

     

    if (BGR.rawValue == "OUT OF RANGE-DESCRIBE/COMMENT") {

        NOTEOOR.presence = "visible";

        RESULTS_OOR.presence = "visible";

        MU.presence = "visible";

        OOR_COMMENT.presence = "visible";

    }

    else if (BGR.rawValue <> "OUT OF RANGE-DESCRIBE/COMMENT") {

        NOTEOOR.presence = "hidden";

        RESULTS_OOR.presence = "hidden";

        MU.presence = "hidden";

        OOR_COMMENT.presence = "hidden";

    }

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points