Is there a way to make dependent dropdowns? #154
Answered
by
sa-si-dev
hassanjrao
asked this question in
Q&A
-
I have two select dropdowns, 2nd dropdown selected option is dependent on first one. So if I select any option from first dropdown, then the respective option in the 2nd dropdown get selected. |
Beta Was this translation helpful? Give feedback.
Answered by
sa-si-dev
Jun 13, 2022
Replies: 1 comment
-
@hassanjrao it has to be handled in your project code. Use change event listener for first drop-down and update the value for second drop-down on first drop-down change. document.querySelector('#sample-select1').addEventListener('change', function () {
const firstValue = this.value;
const secondValue = 'set value for second dropdown based on firstValue';
document.querySelector('#sample-select2').setValue(secondValue);
}); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
sa-si-dev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@hassanjrao it has to be handled in your project code.
Use change event listener for first drop-down and update the value for second drop-down on first drop-down change.