Hello everyone,
Is there much easy way to implement the follwing:
i have 4 comboxes (com1, com2, com3,com4) and 4 tables (tab1, tab2, tab3, tab4)
com1 and tab 1 have master table relationships i.e when in com1 the name is entered tab 1 shows the result of that entry. the same is for the rest comboxes and tables.
Now what i am trying to do is when an user clickes on com1 and types the name of the employee tab2 tab 3 and tab 4 should be hidden. if com2 is clicked tab1 and tab3, ta4 shoud be hidden.etc
Currenty i am using this code which i do not like. Is there any easy and short way to do hide an show.
this is the code i am using
<script type="text/javascript">
$("#com1").on('click', function () {
$("#div1").fadeIn();
$("#tab2").fadeOut();
$("#tab3").fadeOut();
$("#tab4").fadeOut();
});
$("#com2").on('click', function () {
$("#tab1").fadeOut();
$("#tab2").fadeIn();
$("#tab3").fadeOut();
$("#tab4").fadeOut();
});
$("#com3").on('click', function () {
$("#tab1").fadeOut();
$("#tab2").fadeOut();
$("#tab3").fadeIn();
$("#tab4").fadeOut();
});
$("#com4").on('click', function () {
$("#tab1").fadeOut();
$("#tab2").fadeOut();
$("#tab3").fadeOut();
$("#tab4").fadeIn();
});
</script>
<cc1:ComboBox ID="Com1" runat="server">
</cc1:ComboBox>
<cc1:ComboBox ID="Com2" runat="server">
</cc1:ComboBox>
<cc1:ComboBox ID="Com3" runat="server">
</cc1:ComboBox>
<cc1:ComboBox ID="Com4" runat="server">
</cc1:ComboBox>
<br />
<asp:GridView ID="tab1" runat="server">
</asp:GridView>
<asp:GridView ID="tab2" runat="server">
</asp:GridView>
<asp:GridView ID="tab2" runat="server">
</asp:GridView>
<asp:GridView ID="tab4" runat="server">
</asp:GridView>