Hi, Is there a way to set permission on a field with autogenerate on? I want non-admin users to see and search by a field (Date) but I do not want them to be able to change it. Previous tip on http://www.gossamer-threads.com/...cations/Version_1_x/ didn't help.
Jan 23, 2004, 9:05 AM
Novice (5 posts)
Jan 23, 2004, 9:05 AM
Post #2 of 3
Views: 2377
(follow up). just noticed that previous posting on similar problem (quoted above) works for text fields, not select ones. It hides the contents of the field during modify. The code is the one below, to be inserted under sub build_html_record_form (default.cfg should also be changed, with field max length as -3). I wonder if that could be adapted to work with select fields? Thanks
elsif ($db_form_len{$field} == -3) { if (($in{'view_search'} == "1") || ($in{'modify_search'} == "1")) { $output .= qq~<tr><td align=right valign=top width=20%><$font>$field:</font></td> <td width=80%><input type=text name="$field" value="$rec{$field}" size="$db_form_len{$field}" maxlength="$db_lengths{$field}"></td></tr>~; } else { $output .= qq~<tr><td align=right valign=top width=20%><input type=hidden name="$field" value="$rec{$field}"><$font>$field:</font></td> <td width=80%>$rec{$field}</td></tr>~; } }
elsif ($db_form_len{$field} == -3) { if (($in{'view_search'} == "1") || ($in{'modify_search'} == "1")) { $output .= qq~<tr><td align=right valign=top width=20%><$font>$field:</font></td> <td width=80%><input type=text name="$field" value="$rec{$field}" size="$db_form_len{$field}" maxlength="$db_lengths{$field}"></td></tr>~; } else { $output .= qq~<tr><td align=right valign=top width=20%><input type=hidden name="$field" value="$rec{$field}"><$font>$field:</font></td> <td width=80%>$rec{$field}</td></tr>~; } }
Jan 25, 2004, 10:51 AM
Veteran / Moderator (3034 posts)
Jan 25, 2004, 10:51 AM
Post #3 of 3
Views: 2361
I really think you will find there is much more flexibility if you don't use autogenerate. It's not difficult to setup your database input and output layouts.
JPDeni provides a configurator script on her site which will guide you through creating the html_record_form and html_record subs for you. http://jpdeni.com/dbman/
Unoffical DBMan FAQ
http://creativecomputingweb.com/dbman/index.shtml/
JPDeni provides a configurator script on her site which will guide you through creating the html_record_form and html_record subs for you. http://jpdeni.com/dbman/
Unoffical DBMan FAQ
http://creativecomputingweb.com/dbman/index.shtml/