• 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!

TOPIC: Javascript (?) on form element - select return

Javascript (?) on form element - select return 12 years 6 months ago #19246

I have a form with 2 dropdown menus.

1. list of 435 cities, that is "grouped" by a Value: 1 - 21. this values represent 21 states/countries;

example:
2|Bangkok
3|London
4|Oslo
4|Bergen
etc...


2. States 21 items.

When I select a city in dropdown 1, I want the dropdown 2 to show up, and automagicly show the correct State, that is one of 21

Example: I select OSlo, that has a value = 4.
The state that has value 4 is Norway.

Example:
2|Thailand
3|England
4|Norway




How do I make that in RSForm pro?
Last Edit: 12 years 6 months ago by thomas.johannessen. Reason: better description
The administrator has disabled public write access.

Re: Javascript (?) on form element - select return 12 years 6 months ago #19291

So, this is the reverse of the classical example of states and cities where one select a state from the first dropdown, and the cities in the selected state is shown in the second dropdown.

You want to have the cities in the first dropdown, and the state in which the selected city belong to, to be displayed.

I had someone show me how to do this in Fabrik by a calculation element and with the following code (I have two database tables, cities and states):
$db =&JFactory::getDBO();
$db->setQuery("SELECT state_name FROM states where state_number = 
(SELECT state_number FROM cities where city_number = '{formname___city_raw}')");
$s = $db->loadResult();
return $s;

But how to achieve this in RSForm I don't know. If someone knows, I think I will use RSForm instead of Fabrik.
Last Edit: 12 years 6 months ago by donjarleone.
The administrator has disabled public write access.
  • 1

Read this first!

We do not monitor these forums. The forum is provided to exchange information and experience with other users ONLY. Forum responses are not guaranteed.

However, please submit a ticket if you have an active subscription and wish to receive support. Our ticketing system is the only way of getting in touch with RSJoomla! and receiving the official RSJoomla! Customer Support.

For more information, the Support Policy is located here.

Thank you!