Contact Enhanced Documentation

Chained Selects lets you "chain" multiple select lists together so that the selection in a "parent" list can tailor the options available in a "child" list. Chained Selects supports unlimited unlimited number of "chains" in in a form.

In order to Create a chain select list you have to use the SQL Form Field and the fields will be loaded using AJAX JSON Calls.

The first option of a Chain select list can also be a Radio list.

 

SQLs used in this tutorial for Joomla 1.6+:

Getting Country and States from VirtueMart

Setting up the State:

  1. Go to the Custom Field Manager and Hit the new button;
  2. Select the SQL custom field type;
  3. Add the SQL query to the value field in order to create theStatedropdown;:
  4. SELECT state_name AS text, state_id AS value 
    FROM #__vm_state
    WHERE country_id = '{selectresult}';
  5. Set Use chain selectYes;
  6. Set Field to update to your City field; (in case you have a city database table)
  7. Select it's category;
  8. Save the custom field;

Setting up the Country:

  1. Go to the Custom Field Manager and Hit the new button;
  2. Select the SQL custom field type;
  3. Add the SQL query to the value field in order to create the Country dropdown:
  4. SELECT country_name AS text, country_id AS value 
    FROM #__vm_country
    WHERE 1;
  5. Set Use chain select to Yes;
  6. Set Field to update to your state field;
  7. Select it's category;
  8. Save the custom field;

Example using Custom Values

Field You Prefer:

SELECT DISTINCT type AS text, type AS value
FROM #__ce_cv
WHERE published=1
ORDER BY type ASC

Field Select:

SELECT name AS text, value
FROM #__ce_cv
WHERE published=1 AND type='{selectresult}'
ORDER BY text ASC

 

Joomla 1.5 Native SQLs used in this tutorial for Joomla 1.5:

Field You Prefer:

SELECT DISTINCT type AS text, type AS value
FROM #__contact_enhanced_cv
WHERE published=1
ORDER BY type ASC

Field Select:

SELECT text, value
FROM #__contact_enhanced_cv
WHERE published=1 AND type='{selectresult}'
ORDER BY text ASC

Recommend to a friend

Copyright © 2018 IdealExtensions.com. All Rights Reserved.

This site is not affiliated with or endorsed by the Joomla!™ Project. It is not supported or warranted by the Joomla!™ Project or Open Source Matters™. The Joomla!™ logo is used under a limited license granted by Open Source Matters™, the trademark holder in the United States and other countries.
We may collect your IP address and your browser's User Agent string while using our site for security reasons and deriving aggregate information (analytics). This information is retained for a minimum of 1 and a maximum of 24 months.
Feedback