Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    358
    Thanks
    2
    Thanked 0 Times in 0 Posts

    3 layers dropdown list using ASP + SQL Server.

    dear,

    i'm using ASP try to generate a member registration form, let user enter their name, sex, address, country , state... all the record are from Database.

    what problem that i faced is, i want the "State" drop down list changed when user choose different "Country", and when "Postal Code" will Changed when user choose different "State". Can do it without refresh the page? and there are so many countries in the world, if i retrieve all the record of state that belongs to the country it it will be long downloading time??? how to solve them... like hotmail they will refresh the page... but i hope i can do is without refresh the page and not too slow 4 the loading time...

    here is the HTML Code:
    <select name="select" size="1">
    <option selected>Choose Country</option>
    </select>
    </p>
    <p>
    <select name="select2">
    <option selected>Choose State based on your selected Country</option>
    </select>
    </p>
    <p>
    <select name="select3">
    <option selected>Choose Post Code based on your selected State</option>
    </select>
    Thanks.
    =====================================================
    From NinjaTurtle
    ++http://ohmygoh.blogspot.com|http://technology.ohmygoh.com++

  • #2
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,037
    Thanks
    0
    Thanked 250 Times in 246 Posts
    if you want to do it without refreshing the page, you need javascript to do it. but you have to load all the states and postal codes of each country in hidden fields. there are lots of triple combo scripts out there, try to look for them

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Glenn is 100% correct... with *any* server-side language (not just ASP), a request must be made to the server in order to update the page, which can't be done without refreshing the page (or a hidden frame, in which case you'd still have to use javascript on the client-side).

    That's why in order to accomplish this without refreshing, you need a client-side solution (javascript).

    I'll move this post to the javascript programming forum, so you can get more help with dropdown combos.

    P.S. You might want to look at the scripts available for this kind of thing already on http://www.javascriptkit.com !
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #4
    New to the CF scene
    Join Date
    Aug 2002
    Location
    Salem, OR
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    I think I have what you want, but...

    I have been working on a problem just like the one you are talking about, and I have been able to do exactly what you're talking about.

    However, I have found that when dealing with large recordsets, the triple combo approach doesn't work very well (I am, and it sounds like you might be). The code generated by the javascript is 28,490 lines long! It takes about 5 minutes to load every time the page is accessed. Granted, I am working with VERY large recordsets, and right now, I am using three ODBC connections. I have a feeling that with just one, I could cut down the load time substantially.

    Anyway, if you'd still like the code, please let me know


  •  

    Posting Permissions

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