Custom fields to Nested Select Lists

More
12 years 3 months ago - 12 years 3 months ago #34793 by MatteoVi
Hi all,
I need help with custom fields....
I've 2 tables that are related:

Table 1 - regioni: id, name
Table 2 - province: id, name, id_regione

Field 1 is a select list thru a SQL: SELECT id AS value, name AS text FROM `xxx_regioni` ORDER BY name
Field 2 is a select list than depend from field 1.... how I can do that? :?:

SELECT id AS x.value, x.name AS text FROM `xxx_province` AS x LEFT JOIN .... ?????

Tnx in advance for help :P
Matteo
Last edit: 12 years 3 months ago by kenmcd. Reason: clarified title

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #34797 by ggppdk
The question is where you want to use the dependency ?

In item form?

While the page is already rendered and given to the browser ? Then you need to use JAVASCRIPT and AJAX since you are in browser and not at server (where you can use PHP)

So,
the user selects a value in field 1, and then you want to effect field 2 and make it display something that depends on the selected value in field 1?

This is not trivial to make , you would need to create a new custom-developed FLEXIcontent field, we plan to offer an easy way to do it in the select field (without need to create a custom-developed field)


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #34815 by MatteoVi
Hi,
tnx for reply I'm so new to Flexi.... :-D

I'd like to put fields in the form.....

ggppdk wrote: the user selects a value in field 1, and then you want to effect field 2 and make it display something that depends on the selected value in field 1?

Exatly..... the target is: nation -> region -> city ..... and then use FlexiGmap :P

The solution is too complex for me (JAVASCRIPT and AJAX)..... have you an example ????

Please Log in or Create an account to join the conversation.

More
12 years 3 months ago #34817 by ggppdk
It is possible to do something without modifying FLEXIcontent plugin files

You could load all values in second field and create a js file with jQuery commands that will attach
- to the onchange event of field 1
- initially hide all value in field 2
- when field 1 changes they will filter field2 and appear some options

This is custom development that can be done from a professional.

We plan to offer a similar effect built-in , but this is not currently available


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

More
12 years 2 months ago #34930 by MatteoVi
Is it 2.1 feature? I saw that somewhere....

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.304 seconds
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save