I have the below dropdowns. I need to select the second dropdown (email) when the user select an entry in first dropdown (accounts). if accountid2 is selected, email-id2 must be selected. if other, other should be selected. how to do that using onchange function.
<td>11.member's           <br>Account Number:  <br />
<span class="bodyCopy"></span>
<html:select name="DataForm" property="accountNumber" styleClass="formContent"
style="width:80px" >
<option value = "0">Other </option>
<c:if test = "${!empty Data.accountId2}">
<option value = "1">${Data.accountId2}</option>
</c:if>
<c:if test = "${!empty Data.accountId1}">
<option value = "2">${Data.accountId1}</option>
</c:if>
<c:if test = "${!empty Data.accountId3}">
<option value = "3">${Data.accountId3}</option>
</c:if>
<c:if test = "${!empty Data.accountId4 }">
<option value = "4">${Data.accountId4}</option>
</c:if>
<c:if test = "${!empty Data.accountId5}">
<option value = "5">${Data.accountId5}</option>
</c:if>
</html:select>
</td>
<td colspan="3">12. Member's<br>E-mail Address: <br />
<span class="bodyCopy" ></span>
<html:select name="DataForm" property="emailAddress" style = "width:150px"
styleClass="formContent" >
<option value = "0">Other </option>
<c:if test = "${!empty Data.primaryEmail2}">
<option value = "1">${Data.primaryEmail2}</option>
</c:if>
<c:if test = "${!empty Data.primaryEmail1}">
<option value = "2">${Data.primaryEmail1}</option>
</c:if>
<c:if test = "${!empty Data.primaryEmail3}">
<option value = "3">${Data.primaryEmail3}</option>
</c:if>
<c:if test = "${!empty Data.primaryEmail4}">
<option value = "4">${Data.primaryEmail4}</option>
</c:if>
<c:if test = "${!empty Data.primaryEmail5}">
<option value = "5">${Data.primaryEmail5}</option>
</c:if>
</html:select>
</td>