Forum Moderators: open

Message Too Old, No Replies

onchange?

onchange?

         

bourbon_33

10:44 am on Nov 30, 2005 (gmt 0)

10+ Year Member



I am using mysql with a country table and also a state table.
When the user clicks on the country that he/she wants I want do then load the states that go with the selected country, without the page reloading.
What I have is a form with name etc.

I hope someone can help.
Thanks in advance.

Nutter

11:33 am on Dec 1, 2005 (gmt 0)

10+ Year Member



Two choices that I can think of

1 - Load all the states / country combinations into a hidden variable and parse it with JavaScript as the input changes.

2 - Use AJAX. Have a script that returns the states for a country passed and use an HTTPrequest object to open this script when you change countries.

Personally, I'd go for #2.