SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Thread: dynamic dropdown menus

  1. #1
    SitePoint Addict
    Join Date
    Mar 2009
    Posts
    235
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    dynamic dropdown menus

    OK, firstly am no ASP techie, more of a PHP person myself so I need a bit of help here. I have been asked to create a search function for a website which comprises of the following criteria.

    I need 3 dropdown menus. The menus will be populated with data from a SQL database. The menus will need to be: Category -> Product Series -> Product.
    Each dropdown menu will be populated with data depending on the previous menu i.e. the first menu selection populates the second and so on.

    As of now I have 2 menus working. To achieve this I am using some javascript, function reload(form) to pass the value to the next menu. My problem is how can I pass the second menus value to the third menu? Can I use another instance of the javascript function or is there another way of doing it?

    Here is the javascript code I am using

    Code:
    <SCRIPT language=JavaScript>
    function reload(form){
    var val=form.category.options[form.category.options.selectedIndex].value;
    self.location='http://website/search.asp?brand=' + val ;
    }
    </script>
    Cheers

  2. #2
    SitePoint Guru
    Join Date
    Jun 2007
    Posts
    659
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  3. #3
    SitePoint Addict itHighway's Avatar
    Join Date
    Jan 2008
    Location
    GUJ
    Posts
    250
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Try AJAX. The AJAX script is same for both PHP and ASP.

Tags for this Thread

Bookmarks

Posting Permissions

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