phpMyEdit - Viewing Bug Advanced Details [ Go Back ]
314 core / field option feature always 2005-03-02 23:22 2005-03-06 21:37
michal i386  
FreeBSD  
normal 5.1  
feedback current from CVS  
open  
none  
none  
submenu in dropdown
i've really came to need to have menu-submenu option when adding, as was described several times in forum.
it's a situation where there is a city_id as a foreign key from tables cities (standard values option). however i want to have an extra 'region' dropdown which will display only cities from the region in the 'city' dropdown (some cities will not be visible).
i believe this can be done with some js/dhtml code. the problem is i have no idea how it should look like (so that it works with all browsers). i can implement it into the core class, not much of problem.

so can you guide me/post here code that would work as expected ?

Bug Notes
hbernard   
2005-03-05 12:39   
We can do this with OnChange property.

A simple API could be :

$opts['fdd']['foo_field'] = Array(
...
'onchange_reload' => true,
...
nepto   
2005-03-05 13:22   
How about disable this on Add page and construct proper drop-down on the Change page according to the selected city?

(: well, imperfect workaround, however still better than JS mess :)
hbernard   
2005-03-05 14:10   
nepto, I agree with your workaround.

The trouble to make it working with reload is that the JS should be very clever (sending already keyed values, setting the operation value, and so on).

This is much more difficult than I first thought.
michal   
2005-03-06 13:59   
preferably, i would like to do it without any server interaction
reasons:
- to avoid half-filled entries when user stops clicking
- script size is not much of problem
- hopefully, it can be simple and reliable as 'tabs'
hbernard   
2005-03-06 21:37   
michal : 'simple', sure, just write it ;-)))

the issue is :
- what would be the informations required to perform JS runtime filter?
- what would be the semantic of the filter ? (custom func, regexp, basic test, etc...)
- what if I want to display some field depending of the content of another above ?