Results 1 to 5 of 5

Thread: Country and State selections through JS

  1. #1

    Thread Starter
    Hyperactive Member AvisSoft's Avatar
    Join Date
    Sep 2002
    Location
    Chandigarh
    Posts
    459

    Angry Country and State selections through JS

    Hello,

    Very simple but i don't know how to do it. I have seen it on many websites though. I have 2 dropdowns 1 is for country in whcih all countries are listed and other is for states.

    If country selected is USA then fill states box with USA's states. If there is some other country selected then just fill the state dropdown with: Other State.

    How can i do this ?

    Thanks.
    Tapan Bhanot,
    CEO, Avis Software.
    Website: www.avissoftware.com

  2. #2
    Addicted Member
    Join Date
    Jul 2004
    Location
    Mumbai
    Posts
    236

    Re: Country and State selections through JS

    hi

    on the onselect event of the country list submit the form. get the country value from Request.post then generate the state list. if you want to do it without submitting then u can use xmlhttp. but u first try the first option that will be simple in the initial state.. (remember u should have the values in database or file from where u will retrieve..). if u need code then reply in the post.

    --Kishore..

  3. #3

    Thread Starter
    Hyperactive Member AvisSoft's Avatar
    Join Date
    Sep 2002
    Location
    Chandigarh
    Posts
    459

    Re: Country and State selections through JS

    Hi,

    Please help me with code i don't know much javascript.

    Thanks.
    Tapan Bhanot,
    CEO, Avis Software.
    Website: www.avissoftware.com

  4. #4
    Addicted Member
    Join Date
    Jul 2004
    Location
    Mumbai
    Posts
    236

    Re: Country and State selections through JS

    hi avissoft,

    i have attached the asp sample file with this reply. put it on your server and run it.

    -- Kishore...
    Attached Files Attached Files

  5. #5
    Addicted Member
    Join Date
    Jul 2004
    Location
    Mumbai
    Posts
    236

    Re: Country and State selections through JS

    you can also use xmlhttp so that you can refresh without submitting. but you first try this.

    -- Kishore...

Posting Permissions

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



Click Here to Expand Forum to Full Width