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.
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..
Re: Country and State selections through JS
Hi,
Please help me with code i don't know much javascript.
Thanks.
1 Attachment(s)
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...
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...