Hi:
I am trying to limit the drop down menu values based on an earlier entry.
In the example below, I would like to limit the drop down menu for model_id to the make_id selected in the first field.
Table: makes
make_id, make_name
1,Ford
2,Land Rover
3,Acura
Table: models
model_id, model_name, make_id
1,F350,1
2,F250,1
3,F150,1
4,D90,2
5,D110,2
6,Disco,2
7,Intrgra,3
Table: Users
user_id, make_id, model_id
| Kód: |
$opts['fdd']['make_id'] = array(
'name' => 'Make',
'select' => 'D',
'maxlen' => 11,
'options' => 'ACDFLV',
'values' => array(
'table' => 'makes',
'column' => 'make_id',
'orderby' => 'make_name',
'description' => array( 'columns' => array('make_name')
),
'help' => 'Make of car',
'sort' => true
);
$opts['fdd']['model_id'] = array(
'name' => 'Model',
'select' => 'D',
'maxlen' => 8,
'options' => 'ACDFLV',
'values' => array(
'table' => 'models',
'column' => 'model_id',
'orderby' => 'model_name',
'description' => array( 'columns' => array('model_name')
'filters' => 'make_id = "'.$make_id.'"' // <---------- problem here --<<<<
),
'help' => 'Model name',
'sort' => true
);
|
$make_id is a place holder, I would like to feed back the answer from opts['fdd']['make_id'] in here.
When I looked at triggers, it looks like they only are called when the form is submitted/canceled.
What I would like is when a user changes $opts['fdd']['make_id'], the query to fill the drop down option values for $opts['fdd']['model_id'] are rebuilt.
Is this built in somewhere?
Or can I use a ['js'] javascript function to re-write the <option s? It has it's own <select class="pme-input-0" name="PME_data_dispatch_id"
Thank you.
Kent
|