From: Jason <ok...@kd...> - 2003-02-01 02:11:52
|
Julian, I was able to produce a pulldown box while editing a record with = this code, 'values'=3D>array('course','coursecd','coursenm'), just add the above anywhere in the $opts section $opts['fdd']['COURSECD'] =3D array( 'name'=3D>'COURSECD', 'select'=3D>'D', 'type'=3D>'string', 'maxlen'=3D>3, 'nowrap'=3D>false, 'values'=3D>array('course','coursecd','coursenm'), 'required'=3D>false, 'sort'=3D>true =20 ); I hope this is what you want to happen. I also deleted the last , on = 'sort'=3D>true Jason ----- Original Message -----=20 From: PCN-jzambanini=20 To: php...@li...=20 Sent: Saturday, February 01, 2003 5:33 AM Subject: [PHPMyEdit-Discuss] Adding a Drop-Down Box to fields in the = EDIT or ADD PAGE I just downloaded and installed phpMyEdit v.5.2 and all seems to be = working well. My question is: Is it possible to add a drop-down box to = edit or add data while editing a record.=20 = -------------------------------------------------------------------------= --- When I try the suggestion you gave to Roberto Cohen, I do get a = drop-down box keyed on a second table (COURSES) but only the fields from = that point on i.e. where I put the following code (in blue below) are = displayed and the same is true when I view or edit the field - the = listing of the fields starts at that point not displaying the 5 or 6 = fields before this point. The code is the following:=20 $opts['fdd']['COURSECD'] =3D array( 'name'=3D>'COURSECD', 'select'=3D>'D', 'type'=3D>'string', 'maxlen'=3D>3, 'nowrap'=3D>false, 'required'=3D>false, 'sort'=3D>true, =20 ); $fdd['COURSECD']['values']['table'] =3D 'courses'; $fdd['COURSECD']['values']['column'] =3D 'coursecd'; $fdd['COURSECD']['values']['description'] =3D 'coursenm'; $opts['fdd'] =3D $fdd;=20 = -------------------------------------------------------------------------= -------- I have been able to make the drop-down work on the main listing page = following the directions at = http://phymyedit.sourceforge.net/lookups.html and your answer to Roberto = Cohen on the other Maillist where you wrote:=20 "Re: curiosity... about values found in the specified column of = another table=20 2003-01-14 15:53=20 > $opts['fdd']['codcity'] =3D array(=20 > 'name'=3D>'Codcity',=20 > 'select'=3D>'T',=20 > 'type'=3D>'int',=20 > 'maxlen'=3D>6,=20 > 'nowrap'=3D>false,=20 > 'required'=3D>true,=20 > 'default'=3D>'0',=20 > 'sort'=3D>true=20 > );=20 > $fdd['codcity']['values']['table'] =3D 'city';=20 > $fdd['codcity']['values']['column'] =3D 'code';=20 > $fdd['codcity']['values']['description'] =3D 'name';=20 Write=20 $opts['fdd'] =3D $fdd;=20 at the end of your field declarations or use $opts['fdd'] instead of = $fdd=20 for fields definitions. So in your case it should looks like this:=20 $opts['fdd']['codcity']['values']['table'] =3D 'city';=20 $opts['fdd']['codcity']['values']['column'] =3D 'code';=20 $opts['fdd']['codcity']['values']['description'] =3D 'name';"=20 but this does not give me a drop-down on the edit page. Is there a way = to do this.=20 Thanks for any help you can give.=20 Julian=20 =20 |