Gossamer Forum
Home : Products : DBMan : Customization :

Hidding the primary key

Quote Reply
Hidding the primary key
Is there any way for the script to NOT display the primary key (aka ID field) of the elements it returns? No one really cares if the ID of the returned record is 245 and it would look a lot better if I could simply not display that.

Any ideas?

Thanks very much!

Giorgos
Quote Reply
Re: Hidding the primary key In reply to
Sure. Just make it a hidden field:

<INPUT TYPE="hidden" NAME="ID" VALUE=$rec{'ID'}>



------------------
JPD
Quote Reply
Re: Hidding the primary key In reply to
OK, seems logical, but what if I use auto-generated forms?

John
Quote Reply
Re: Hidding the primary key In reply to
Set the field length to -1 in your .cfg file.


------------------
JPD
Quote Reply
Re: Hidding the primary key In reply to
Thanks, JPDeni! That did it.

John
Quote Reply
Re: Hidding the primary key In reply to
Hmm ... I have now sucessfully removed the showing of the ID-number. However, it would be nice if it would actually show up when I as administrator login. Any simple way to do so?

John
Quote Reply
Re: Hidding the primary key In reply to
If you're using auto_generate, set the field length to -2.

If you're building your own html_record and html_record_form, use

Code:
|;
if ($per_admin) {
print qq|$rec{'ID'}|;
}
print qq|

subsitituting $rec{'ID'} with whatever you want to print out for the admin to see.


------------------
JPD