| Index
» Projekty
» phpMyEdit
» Fórum
» Need help with a simple dropdown |
 |
RCurtis
Založený: 19.09.2013
Príspevky: 10
Zaslal: 2013-11-04 23:16
Návrat hore
Odpovedať s citátom
|
Perhaps I am missing a fundamental truth here...
All of the examples I have seen for drop down menus appear to refer to lookups from another table. I only need what I *think* is referred to as an input restriction. When the user adds/edits a given field he/she is shown a dropdown with 3 possible selections. (Not selections from a table)
It appears that this is a portion of what is required:
$opts[’fdd’][’col_name’][’values’] = array(”,’Yes’,’No’); // default is ” (nothing)
Then, a 'select' code of 'D' for drop down
I just want to supply the 3 selections within the "values".
I can't get this to work...what am I missing?
|
doug
Založený: 10.02.2003
Príspevky: 1013
Bydlisko: Denver, Colorado (USA)
Zaslal: 2013-11-05 16:13
Návrat hore
Odpovedať s citátom
|
col_name should be replaced with the name of your column
|
RCurtis
Založený: 19.09.2013
Príspevky: 10
Zaslal: 2013-11-05 17:01
Návrat hore
Odpovedať s citátom
|
OK...I have a bit more info. Somehow I have gotten a new field to properly show a dropdown in the change view.
The first definition here (user_late_year_registration) properly shows a dropdown with blank, Yes, No
The second definition shows only a standard text box field. Am I blind? I can't see anything different between the two in the way they are set up.
$opts['fdd']['user_late_year_registration'] = array(
'name' => 'User late year registration',
'select' => 'D',
'values' => array('','Yes','No'), // default is '' (nothing)
'maxlen' => 255,
'sort' => true
);
$opts['fdd']['user_Pay_Method'] = array(
'name' => 'Payment Method',
'select' => 'D',
’values’ => array('',’Check’,’Cash’,'PayPal'), // default is '' (nothing)
'maxlen' => 255,
'sort' => true
);
What am I doing wrong?
|
RCurtis
Založený: 19.09.2013
Príspevky: 10
Zaslal: 2013-11-06 01:31
Návrat hore
Odpovedať s citátom
|
I have found my problem...this is really strange!
’required’ => true,
'sort' => true
The previous lines did not actually contribute to my problem but they contain the clue.
Note the difference in the quote marks used around each of the options. The marks around "required" do not work! Somehow I had several sets of those incorrect marks around some of my "key" items required for a dropdown (such as the 'values' line) and PME just plain refuses to honor them. The incorrect marks were copied from various code snippets here in the forum or possibly directly from the documentation, so beware! If you can't get something to operate based on what the documentation *says* will work...take a look at your quote marks!!
|
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|