Auto Selecting Options from DropDownList Using jQuery
<p>I have a scenario where I have several dropdownlist like the following: </p>

<pre><code>DropDownList 1
DropDownList 2
DropDownList 3

TextBox
TextBox
TextBox

DropDownList 4 
DropDownList 5 
DropDownList 6 
</code></pre>

<p>Now, when I select a value from DropDownList 1 it should be automatically selected in DropDownList 4. </p>

<p>When I select a value in DropDownList 3 then it should be selected automatically in DropDownList6. </p>

<p>The ddl groups can go forever and I can select any DropDownList first.</p>

<p>I add a class to the Dropdownlist when it is added to the screen. This adds the same class to all the dropdownlist which are added in a batch.</p>

<p>function setOptionDDLValue(source) {</p>

<pre><code>var uniqueClassPerOptionGroup = $(source).attr("class").split(' ')[1];

$("." + uniqueClassPerOptionGroup).each(function(index, element) {

    $(element).val($(source).val()); 
});
</code></pre>

<p>}</p>
