Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Pondelok, 30. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  Limiting values based on field in same table

phpMyEdit Configuration     Limiting values based on field in same table
Odoslať novú tému   Odpovedať na tému    
 
kent     Založený: 30.11.2007   Príspevky: 1  
Príspevok Zaslal: 2008-06-04 00:17
Návrat hore  Odpovedať s citátom     

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

 
DaaL1973     Založený: 09.12.2007   Príspevky: 7  
Príspevok Zaslal: 2008-08-15 18:38
Návrat hore  Odpovedať s citátom     

kent Napísal:
Hi:

I am trying to limit the drop down menu values based on an earlier entry.

Kent


I also need to implement this same function - can anyone help please?

 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov