I have two dropdown list. These two are not interdependent on each other.
The values in the first dropdown list are [ 'one', 'two', 'three', 'four' ].
The values in second dropdown are [ 'ten', 'nine', 'eight', 'seven' ].
If I select two in the first dropdown then second dropdown should be auto-populated with nine.
I have tried this.
var value1=document.getElementById('ddlone').value;
if(vaue1=='two'){
document.getElementById('ddlone').selectedValue='nine';
} else {
document.getElementById('ddlone').selectedValue='';
}
But I didn't get the expected result. Please help me in this regard.
changeon first select. There you define a function which will be executed by browser when user changes value of first selector. And you can define your code there to programmaticaly change selected value of second selector, like you did in your code.