0

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?

  • 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
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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