Hi,

I want to display a different part of the page based on a dropdown box
selection.How can i do that ?

I have tried the following but this does not change the intially displayed
page.
1. Javascript: 
<script language="javascript" type="text/javascript">
                function selectDropDown(optionSelected)
                {
                <%String selectIncomeType="";%>
                if(optionSelected == "Earned") {
                 <%
                    selectIncomeType="Earned";
                        %>
                        }
                        if(optionSelected == "Unearned") {
                        <%
                      selectIncomeType="Unearned";
                        %>
                        }
                }
</script>

2. Actual dropdown select:
<select name="incomeType" size=1
onChange="selectDropDown(this.options[this.selectedIndex].value);">
        <option value ="" >Select One</option>
        <option value ="Unearned">Unearned</option>
        <option value ="Earned">Earned</option>

</select>

3. To display diff parts of the page:
<% if (selectIncomeType.trim().equals("Unearned")) {%>
   do something
<%}%>
<% if (selectIncomeType.trim().equals("Earned")) {%>
        do something else
<%}%>

TIA,
Vijay

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to