dcsimg
www.webdeveloper.com
Results 1 to 4 of 4

Thread: Refreshing HTML SELECT OPTIONS after populating/selecting another field on the page

  1. #1
    Join Date
    Feb 2003
    Posts
    3

    Refreshing HTML SELECT OPTIONS after populating/selecting another field on the page

    I have a number of SELECT statements which allow me to choose from OPTIONS created with ASP and an SQL Select on an (Access) database. I want to make subsequent SELECT's dependant on options selected from previous fields, and to populate these with the results of further SQL select statements. This is like the REQUERY facility within Access.

    I can use onChange to execute a JAVA function held within the header block but cannot access SQL with this ... or can I ?

    Any ideas ?

  2. #2
    Join Date
    Feb 2003
    Posts
    3
    Thanks Dave .... I will look into the first option ... if you know where I might be able to find an example perhaps you could let me know. Cheers.

  3. #3
    Join Date
    Feb 2003
    Posts
    5
    Is this the kind of thing you are looking to do ??

    http://www.quantel.com/domisphere/in.../html/contacts

    As you change the selections, the fields to the right change accordingly - is that what you wanted ??

    By all means look at (and rip off !) the source code.
    Basically what I did here was to query the database and return all of the values.
    The values are fed into a series of javascript functions that create arrays.
    Heres the messy bit - the arrays are unknown at development time - IE I dont know how many Contact Types there will be, and for each Contact Type how many Countries there will be, and for each Country, how many Cities there will be.

    So, the JS functions create dynamically named arrays (yuck - a nightmare to document and debug !)

    The arrays are then used to populate the <option> tags of the 3 <selects>; and I use onChange to re-populate the <option> tags of the successive <select> tags.

    Not pretty, but it does work - and I'm pretty pleased with it. If you want to know more about this, let me know.

    Regards

    Nathan
    nathan.russell@quantel.com

  4. #4
    Join Date
    Feb 2003
    Posts
    3
    Thanks Nathan .... this is just what I need. I will give it a go.

    Chris

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles