| | |||||
| ||||||||
| Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics. |
![]() |
| | LinkBack | Thread Tools |
| | THREAD STARTER #1 (permalink) |
| NamePros Regular Join Date: Feb 2005
Posts: 578
![]() ![]() ![]() | comboboxes how to? hi everyone, I want to make 2 comboboxes: country and city, but I want the values on city change base on that country user select. ex: if we select USA then we will see New York but not Tokyo, but if we select Japan then we only see Tokyo, not NY. How do i do that? Code: <select name="country"> <option disabled selected>Select</option> <option value="us">USA</option> <option value="japan">Japan</option> </select> <select name="city"> <option disabled selected>Select</option> <option value="1">New York</option> <option value="1">Tokyo</option> </select>
__________________ Freebies and Giveaways - Printable Coupons - Hot Deals - Coupons - Deal of the Day |
| | |
| | #2 (permalink) |
| NamePros Member Join Date: Mar 2010
Posts: 124
![]() | That can't be done with HTML alone, so you'll need to use JavaScript. On the first combo box, you can add an onchange event that looks at the selection and populates the second combo box accordingly.
__________________ DirectWWW - an OpenSRS reseller |
| | |
| | #3 (permalink) |
| Domains my Dominion Join Date: Aug 2005 Location: Web 1.0
Posts: 9,963
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() | Or use Ajax, here is an example: http://www.w3schools.com/ajax/tryit....yajax_database
__________________ NameNewsletter.com - free lists of available domain names ZoneFiles.net (beta) - ccTLD and gTLD droplists |
| | |