Conditional Fields depending on checkboxes
-
I’m currently trying the following (simplified objects):
I have a bunch of “objects”, which are cities. Each city has a relating country (even though I’m not sure how to implement this relation, yet), so for example I have the following cities:
Stuttgart – Germany
Berlin – Germany
Dresden – Germany
Paris – France
Marseille – France
Lyon – France
New York – USA
Chicago – USA
LA – USA
Miami – USA
Peking – China
Shanghai – China
Hongkong – China
I think you get what I mean.Additionally, I have some checkboxes, including the country, so in the case of the list provided, I would 4 checkboxes, one for Germany, one for France, one of USA and one for China.
When ticking one of this checkboxes, the relating cities should appear underneath, when ticking two of the checkboxes, the cities of both checked countries should appear, and so on.
Actually, I have no idea how to get this started. In a normal web application, I would just create a database table with 3 columns (ID, City, Country) and then in my frontend just react on the checkbox.change, send AJAX to a php file, which gets the requested objects from database (something like select * from tbl_cities where country=germany) and just echo them.
Is something similar possible in WordPress? Are there plugins for things like that, or how could I get this started?
-
You failed to provide the URL of the site you are referring to and we cannot accurately answer any support questions without the URL and verifying where the site is hosted.
To save you time you can type the actual URL of the site you are referring to into http://whoishostingthis.com to determine who hosts the site so you know where to post for support.
We provide support only for sites hosted on WordPress.COM servers. You could be posting to the wrong support forum. To be clear we do not provide support for local installs of WordPress.ORG software, or for WordPress.ORG software installs on paid hosting, linked to WordPress.COM accounts with the Jetpack plugin so they display on the My Sites WordPress.COM account page.
WordPress.COM and WordPress.ORG are completely separate and have different username accounts, logins, features, run different versions of some themes with the same names, and have separate support documentation and separate support forums. Read the differences here http://en.support.wordpress.com/com-vs-org/
The wordpress.ORG support forum is at http://wordpress.org/support. The wordpress.ORG login link is here https://login.wordpress.org/ If you do not have an account yet then click Create an account https://login.wordpress.org/register/ and if you have lost an account password click Lost password? https://login.wordpress.org/lostpassword/
WordPress.org support docs are at https://codex.wordpress.org/Main_Page
See also https://apps.wordpress.org/support/ for app support.
- The topic ‘Conditional Fields depending on checkboxes’ is closed to new replies.