Please help me with this I need to know how to write the query to get the data dynamically

Implement in Ajax module a form with URL “ajax/form”. The form will have two dependent fields so the second is reloaded via Ajax depending on the value selected in the first one. Both of them will be of type list.

The first field is a list of countries obtained from a table called table1, with the following fields “id_country” (two-letter code) and “country” (country name).

She second field is a list of states obtained from a table called tabl2, with fields “id_country”, “id_state” (numeric) and "state (name of the province/state).

Create a function which returns the list of countries. Create a function which returns the list of provinces/states given a id_country.

Implement the form so that the provinces/states are reloaded via Ajax without reloading the entire page. You won’t need to implement the submit of the form. To test the module add to the table at least 3 countries and 2 provinces/states associated to each one.

Is this a school assignment?

Yes I tried to do it to some limit but just can’t write the query.

Show us how far you have got.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.