Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

i have custom fields like this:

  • "country" - values: "USA", "Russia", "China"
  • "city" - values: "Chicago", "Moscow", "Beijing"

I want when user in custom field "country" choose value "USA" after that in custom field "city" show only "chicago". Is it possible? And how can I do this?

share|improve this question
    
How are "city" and "country" associated in the software? –  s_ha_dum Mar 6 '13 at 14:26
    
city is a part of country if I understod your question. –  Paulius Jakštas Mar 6 '13 at 14:52
    
Well, yes. I know that. If I don't know what country a city is in I can look it up, but how does the software know? Software doesn't think. –  s_ha_dum Mar 6 '13 at 14:57

1 Answer 1

up vote 0 down vote accepted

This is possible by using AJAX.

The following links are containing more information about AJAX and implementation in WordPress:

Ajax (Asynchronous JavaScript And XML) is a technology that allows a web page to perform actions or update dynamically, without completely reloading

This article, aimed at plugin developers, describes how to add Ajax

When using WordPress as a CMS, situations often arise where you need to display, add or update content on your WP site without turning to plugins. While bolting in some PHP alone can do the job, nothing is more seamless that the magic of jQuery’s AJAX

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.