| Index
» Projects
» phpMyEdit
» Forum
» How to have hidden variables used in Add record? |
 |
Objectivist
Joined: 14 May 2004
Posts: 3
Posted: 2004-05-14 21:08
Back to top
Reply with quote
|
I need to be able to set the value of a column (or generally, columns) that are totally hidden from the user but which will be inserted into the database table on an Add operation. For example, for a integer column 'role', I have:
$opts['fdd']['role'] = array(
'name' => 'Role',
'select' => 'T',
'maxlen' => 11,
'default' => '2',
'required' => true,
'sort' => true
);
$opts['fdd']['role']['options']='H';
$opts['fdd']['role']['values']=array('2');
in order to set the value of 'role' to 2 but not show it to the user. However, on an Add operation, the inserted value of 'role' in the new record is the default value of 0, leading me to think that it isn't being specified at all in the actual database INSERT.
I love this system but this issue has stopped me from doing what I need to do. Anybody with a solution, please help.
Phil
|
Objectivist
Joined: 14 May 2004
Posts: 3
Posted: 2004-05-14 21:53
Back to top
Reply with quote
|
Thanks very much. I think that should be made more explicit in the documentation. It would be more logical to have any columns specified in the $opts array included in the Add operation, in my view. It is arguably a bug that it doesn't. I think it would be more logical and object oriented to have the hidden default values automatically included in the form. Why else are they being specified in the $opts array at all? Otherwise what's the purpose of even being able to specify that a value is hidden from input?
Phil
|
|
Post new topic
Reply to topic
|
|
|
|