CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2008

    Can you give me an Idea on this ?

    Hi ,

    In my page i need to use two different dropdowns, one is for to display Users and other one is for to display Groups. But at a time only one dropdown will display. For this functionality i am using one more dropdown with values Users and Groups. When i select Users from dropdown only Users related dropdown will display and when i select Groups from dropdown only Groups related dropdown needs to display. Can you give an Idea on this one. ??

    Thanks in advance....

  2. #2
    PeejAvery's Avatar
    PeejAvery is offline Super Moderator Power Poster
    Join Date
    May 2002

    Re: Can you give me an Idea on this ?

    Do you ever do any research before posting? Have you gone through any JavaScript tutorials?

    This is a very basic concept. Use the onchange attribute of the dropdown to change the CSS of the other two dropdowns.

    <script type="text/javascript">
    function changeDropDown(which) {
      if (which == "groups") {
        document.getElementById('groups').style.display = "";
        document.getElementById('users').style.display = "none";
      else {
        document.getElementById('groups').style.display = "none";
        document.getElementById('users').style.display = "";
    <select onchange="changeDropDown(this.value)">
      <option value="groups">Groups</option>
      <option value="users">Users</option>
    <select id="groups" style="display: none;">
    <select id="users" style="display: none;">
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.