Solved
JavaScript to list Options in next question based on answer to prior question
Hi everyone,
I have a question that shows a list of PC names that pertains to the user taking the survey. They are required to choose options from a dropdown list for thoe PC names. I have created an embedded data called "OtherSelected" with the value of whenever Other Departmental Shared PC is selected from the dropdown list. I want it so that my next question displays the PC names where the user selected "Other Departmental Shared PC" for that PC name in list view. I am having trouble with the JavaScript. Any help would be much appreciated. Thanks!!
Best answer by TomG
Your selectors are wrong.
There is no such thing as an input[type=dropdown]. It is select.
Then "input:dropdown:Other Departmental Shared PC(:selected)" is wrong too. If you need to use the text to find it is the innerHTML of the selected option. It would be easier to use the value of the select (i.e. the choiceid for Other Departmental Shared PC).
Finally, assuming this is a matrix, neither the tree traversal nor selector (label.DropdownList) are valid. You need to traverse up the table row (tr) then search down to find the label text.
It would make it easier if you just find all the selects at the beginning of the script and base everything off that:
```
var selects = jQuery("#"+this.questionId+" select");
selects.change(function() { etc...
```
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
