NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page comboboxes how to?

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Reply
 
LinkBack Thread Tools
Old 12-14-2010, 12:54 AM THREAD STARTER               #1 (permalink)
NamePros Regular
Join Date: Feb 2005
Posts: 578
abcde is a jewel in the roughabcde is a jewel in the roughabcde is a jewel in the rough
 



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>
abcde is offline   Reply With Quote
Old 12-14-2010, 04:04 PM   #2 (permalink)
Qc4
NamePros Member
Join Date: Mar 2010
Posts: 124
Qc4 is on a distinguished road
 



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
Qc4 is offline   Reply With Quote
Old 12-15-2010, 02:25 AM   #3 (permalink)
Domains my Dominion
 
sdsinc's Avatar
Join Date: Aug 2005
Location: Web 1.0
Posts: 9,963
sdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatnesssdsinc Has achieved greatness
 


Third World Education Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Find Marrow Donors! Animal Rescue Animal Cruelty AIDS/HIV Animal Rescue Wildlife Breast Cancer Animal Rescue Wildlife
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
sdsinc is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 02:42 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger