m123ooo
Joined: 29 Sep 2011
Posts: 4
Posted: 2011-09-29 11:16
Back to top
Reply with quote
|
When I change view mode from Filter to Change text boxs are empty. Example is shown on the two images below.
Does anyone know why are text boxs empty and how to fix this?
Filter View:
Change View:
My code:
| Code: |
$opts['fdd']['subjectID'] = array(
'name' => 'SubjectID',
'select' => 'T',
'options' => 'AVCPDR', // auto increment
'maxlen' => 11,
'default' => '0',
'sort' => true
);
$opts['fdd']['personID'] = array(
'name' => 'Person',
'select' => 'T',
'maxlen' => 11,
'sort' => true,
'help|ACP' => '<a href="persons_edit.php" target="_blank">
<!--[if !IE]> -->
<input type="button" value="Add person">
<!-- <![endif]-->
<!--[if IE]>
Add person
<![endif]-->
<a/>'
);
$opts['fdd']['personID']['values']['table'] = 'persons';
$opts['fdd']['personID']['values']['column'] = 'personID';
$opts['fdd']['personID']['values']['description']['columns'][0] = 'firstname';
$opts['fdd']['personID']['values']['description']['divs'][0] = ' ';
$opts['fdd']['personID']['values']['description']['columns'][1] = 'lastname';
$opts['fdd']['personID']['values']['filters'] = 'groupID <> 4';
$opts['fdd']['studyProgrammeID'] = array(
'name' => 'Study Programme',
'select' => 'T',
'maxlen' => 11,
'sort' => true
);
$opts['fdd']['studyProgrammeID']['values']['table'] = 'study_programmes';
$opts['fdd']['studyProgrammeID']['values']['column'] = 'studyProgrammeID';
$opts['fdd']['studyProgrammeID']['values']['description']['columns'][0] = 'title';
$opts['fdd']['title'] = array(
'name' => 'Title',
'select' => 'T',
'maxlen' => 200,
'sort' => true
);
$opts['fdd']['year'] = array(
'name' => 'Number of years',
'select' => 'N',
'maxlen' => 1,
'sort' => true
);
$opts['fdd']['hours'] = array(
'name' => 'Number of hours',
'select' => 'N',
'maxlen' => 3,
'sort' => true
);
$opts['fdd']['lectures'] = array(
'name' => 'Number of lectures',
'select' => 'N',
'maxlen' => 3,
'sort' => true
);
$opts['fdd']['exercises'] = array(
'name' => 'Number of exercises',
'select' => 'N',
'maxlen' => 3,
'sort' => true
);
|
|
doug
Joined: 10 Feb 2003
Posts: 1013
Location: Denver, Colorado (USA)
Posted: 2011-09-29 17:45
Back to top
Reply with quote
|
Those images are awfully small. Try replacing ['values'] with ['values2']
|
m123ooo
Joined: 29 Sep 2011
Posts: 4
Posted: 2011-09-29 18:04
Back to top
Reply with quote
|
Click images and in new window scroll down. Then you will see full size.
The problem isn't just with those that have ['values'].
Text boxes are also empty at
| Code: |
$opts['fdd']['title']
$opts['fdd']['year']
$opts['fdd']['hours']
|
etc..
Did you had similar problem?
|
doug
Joined: 10 Feb 2003
Posts: 1013
Location: Denver, Colorado (USA)
Posted: 2011-09-29 18:09
Back to top
Reply with quote
|
Lacking the time to fully study the code, I suggest re-creating the form from scratch, then making small modifications and testing after each modification.
|
m123ooo
Joined: 29 Sep 2011
Posts: 4
Posted: 2011-09-29 18:20
Back to top
Reply with quote
|
The problem is, that if a form from scratch has this problem.
I thought maybe I wrote something wrong, then test fresh form and had same problem.
And not only that.. Some forms when I add new record, they don't store it in database. For instance.. 'title' column in database stays empty or if I write 'number of years' has 0 in database column.
...
I have found the problem.. I was tweaking phpMyEdit.class.php and now, everything is working properly.
I was searching the problem in my edit.php, but you helped me notice that it might not be the problem here.
Thank you for your help!
|
doug
Joined: 10 Feb 2003
Posts: 1013
Location: Denver, Colorado (USA)
Posted: 2011-09-29 18:28
Back to top
Reply with quote
|
You might want to make sure the names of your columns, tables, and databases are NOT reserved words.
http://www.hockinson.com/programmer-web-designer-denver-co-usa.php?s=43
|
m123ooo
Joined: 29 Sep 2011
Posts: 4
Posted: 2011-09-29 18:37
Back to top
Reply with quote
|
Thanks! I will check those tables that have this problem.
Do you perhaps know how to create dummy/virtual column (without MySQL error 1054) and show values from another table and store them in 'another' table in Add view?
|
doug
Joined: 10 Feb 2003
Posts: 1013
Location: Denver, Colorado (USA)
Posted: 2011-09-29 19:11
Back to top
Reply with quote
|
Not really, though I do have this example where the 'user' column already exists before the dummy field is added.
| Code: |
$opts['fdd']['user'] = array(
'default' => '',
'input' => '',
'maxlen' => 20,
'name' => 'User Name',
'options' => 'ACPVDFL',
'required' => true,
'select' => 'D',
'size|ACP' => 20,
'sqlw' => 'TRIM("$val_as")',
'sort' => true,
'values' => array(
'table' => 'vs_users',
'column' => 'user_name',
'description' => array(
'columns' => array('0' => 'last_name', '1' => 'first_name'),
'divs' => array('0' => ', '),
),
'filters' => 'hidden = "0" AND deleted = "0"',
'orderby' => 'last_name')
);
// Dummy/Virtual field looks up user level, displaying it in lighter color
// PMEjoin1 was created above when looking up last_name and first_name
$opts['fdd']['virtual_1'] = array(
'colattrs' => 'style="color:#999999;background-color:transparent"',
'input' => 'VR',
'name' => 'UL',
'options' => 'LFV',
'sql' => 'PMEjoin1.user_level'
); |
|
|
Post new topic
Reply to topic
|
|