Cascading Dropdown watching an All Field

joomlamate

Member
I am trying to create a cascading dropdown that will watch a previous radio button list with options, then it will filter and display results based on the above element.
What I want also is to add an "All" option in my radio buttons, that will be the default selection when form loads and also will display all options in my cascading dd.

So far, I can't make it work, because radio button returns its value quoted, and then the cascade query the database for this value (setting the All option's value to have the name of the foreign key field.

Trying to use also the advance tab, to create my query, but I can't think of a way that will let me create the appropriate query, so when "All" selected in radio button, the list will display all options from the database.

Any ideas, suggestions ?
 
ok here it is my workaround:

I created a new hidden field on my tables which holds the "All" value as "0" by default in all rows.

In my radio button, I set an "All" option with value "0".

Then I adjusted the query of the cascade element, so it uses the value of the radiobutton, as below:


Code:
where block = 0 AND id IN
 
(
select u.id from table_customers as u left join sapp_users_profile a p on u.id = rep_user_id
where u.initial_letter_calc = {radiobutton_value} AND p.representative_status = 2
)
/* Here I use the radio button value to filter the dropdown results based on the actual field I want.
 
OR id IN
 
(
select u.id from table_customers as u left join sapp_users_profile as p on u.id = rep_user_id
where filter_all = {radiobutton_value} and p.representative_status = 2
)
/* Here I use the radio button value 0 and query to the column that holds the 0 value, so it returns all rows.
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top