dimitar Posted November 22, 2007 Share Posted November 22, 2007 I want to add two <select> fields, and i want if some option from first selsect is chosen other options to be showed in second.For ex. i have one select with option countries. and when i choose some opttion from the country select(for example U.K) in the second select the options to be citys from that country(for example London etc), and if i choose (Spain) in the second <select> to be displayed other options for example madrid, barcelona etc. Link to comment Share on other sites More sharing options...
Ingolme Posted November 22, 2007 Share Posted November 22, 2007 It's a little complicated, you have to have the list of the cities for each country stored somewhere (a database or XML file). When you change the select option, you have to use javascript to get the list of cities for the selected country and append <option> nodes to the other <select>. Making the full code would take me a little while, so I'm not going to do it. Link to comment Share on other sites More sharing options...
dimitar Posted November 22, 2007 Author Share Posted November 22, 2007 I don't mean on every country if you think on that. I meant that system. IN this case the options are 4, and the list of the second <select> will be list from db. Link to comment Share on other sites More sharing options...
Reg Edit Posted November 23, 2007 Share Posted November 23, 2007 I don't mean on every country if you think on that. I meant that system. IN this case the options are 4, and the list of the second <select> will be list from db.That makes no difference. It is still as Ingolme said. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.