Gossamer Forum
Home : Products : DBMan : Customization :

> Create select_fields

Quote Reply
> Create select_fields
I like to be able to create for every entry in the database a different "select_fields" Type of input tag.

How can I do that ?

Please help !
Quote Reply
Re: > Create select_fields In reply to
Use the %db_select_fields array in the default.cfg file to do this, like the following:

Code:
%db_select_fields = (
FieldName1 => 'value1,value2,value3,value4,value5',
FieldName2 => 'value1,value2,value3,value4,value5',
FieldName3 => 'value1,value2,value3,value4,value5
);

Replace FieldName1 with the name of the field in your db_def section. Replace the values with the values you want to have people choose from for these fields.

Then in your sub html_record_form routine in the html.pl, you would put the following codes:

Code:
<TR><TD VALIGN="TOP" WIDTH="300"><$font><B>FieldName1:</B></FONT></TD>
<TD VALIGN="TOP" WIDTH="300"><$font><b>Check all that apply:</b></FONT><P>
<$font>|; print &build_select_field ("FieldName1", "$rec{'FieldName1'}"); print qq|</FONT></TD></TR>

Replace FieldName1 with the name of the field you want to have a drop-down menu.

You would put these same codes in your sub html_record and/or sub html_record_long routines in the html.pl file.

Hope this helps and Good luck.

Regards,


------------------
Eliot Lee
Anthro TECH,L.L.C
www.anthrotech.com
----------------------