I have 2 dependent selector and i want change selected dropdown 2 when i change dropdown 1
I have two dropdowns, both of which have 2 values, the first of which shows the value of 1 by default, and the second of which shows the value of 2.
I want when the first dropdown is changed and for example the second value is selected, the second dropdown is changed and the value 1 is selected.
When you have an onchange of first drop down, send that data to back end and retrieve the data for second drop down.
Is normally how it's done.
Edit:
It looks like you only want to change the drop down 2 value when the drop down 1 changes.
Just thinking would it be easier if the user selects a value in drop down 1, and the correct value for the other drop down is retrieved from the back end and put in a text box instead of using a second drop down?
Normally dependent dropdowns are used for things like state and city, and when the state changes the second drop down is updated with the new list of cities for that State.
@Tray2 Yes. This is exactly what I want to do
But this method does not work in my code.
And I tried various other methods which are correct outside of my code but when it comes to my project it doesn't work and I don't understand why