Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Damn Checkboxes...:(

Quote Reply
Damn Checkboxes...:(
Greetings!

Thanks to you help, dear forum members, I'm almost done to my database. It works fine and the file upload is perfect. Just have 1 little problem....I have a "categories" field (checkboxes) with many different categories for artists (writers, musicians, etc).

I decided to use checkboxes because lots of people are both musicians, writers, painters etc. Anyway...it works fine, except that in the database only the first category shows up, if I check more than one.

Here's the default config file:
____________________________________

%db_def = (
id => [0, 'INT', -1, '', '', '', '', 1],
userid => [1, 'CHAR', -1, 20, '', '', '', 0],
Nome => [2, 'CHAR', 50, 100, 1, '', '', 0],
Local_de_Nascimento => [3, 'alpha', 40, 100, 0, '', '', 0],
Dia_de_Nascimento => [4, 'CHAR', 2, 2, 0, '', '', 0],
Mes_de_Nascimento => [5, 'CHAR', 2, 2, 0, '', '', 0],
Ano_de_Nascimento => [6, 'CHAR', 4, 4, 0, '', '', 0],
Rua => [7, 'alpha', 50, 100, 0, '', '', 0],
Bairro => [8, 'alpha', 30, 30, 0, '', '', 0],
Cidade => [9, 'alpha', 30, 50, 0, '', '', 0],
Estado => [10, 'alpha', 30, 30, 0, '', '', 0],
Pais => [11, 'alpha', 30, 30, 0, '', '', 0],
Cep => [12, 'alpha', 10, 15, 0, '', '', 0],
Cod_PA => [13, 'alpha', 3, 3, 0, '', '', 0],
Cod_ST => [14, 'alpha', 3, 6, 1, '', '', 0],
Fone1 => [15, 'alpha', 3, 3, 1, '', '', 0],
Fone2 => [16, 'alpha', 4, 4, 1, '', '', 0],
Fax1 => [17, 'alpha', 3, 3, 0, '', '', 0],
Fax2 => [18, 'alpha', 4, 4, 0, '', '', 0],
Pager => [19, 'alpha', 20, 40, 0, '', '', 0],
Email => [20, 'alpha', 50, 100, 1, '', '.+@.+..+', 0],
Ocupacao => [21, 'alpha', 40, 255, 1, '', ''],
Bio => [22, 'TEXT', '40x4', 10000, '', '', '', 0],
Hobbies => [23, 'TEXT', '40x4', 10000, '', '', '', 0],
Curriculum => [24, 'TEXT', '40x4', 10000, '', '', '', 0],
URL => [25, 'alpha', '40', 100, 0, 'http://', '^http://', 0],
Data => [26, 'DATETIME', 30, 30, '', , '', 0],
Menssagem => [27, 'alpha', '40x4', 255, '', '', '', 0],
Extra => [28,'alpha',-1,255,0,'','', 0],
Categoria => [29, 'CHAR', 30, 255, '', '', '', 0],
Graphic => [30,'alpha',-2,255,0,'Yes','', 0],
Filename => [31,'alpha', 50, 100, 0, '', '', 0],


# Checkbox fields. Field name => Checkbox value.
%db_checkbox_fields = ( Categoria => 'Música,Diretor(a),Arte Visual,Ator/Atriz,Literatura,Performance,Escultura,Artesanato,Crítico(a),Promoter,Apenas interessado em Arte,Outro(a)');


And here's the corresponding html.pl file
___________________________________________

<TR><TD ALIGN="Right" VALIGN="TOP"><$font>* Categoria</FONT></TD>
<TD VALIGN="TOP">|; print &build_checkbox_field ("Categoria", "$rec{'Category'}"); print qq|</TD></TR>

any suggestions?

Thanks in advance!

Quote Reply
Re: Damn Checkboxes...:( In reply to
I believe that the problem could be related to the () values you have in the %db_checkbox_fields.

Regards,

Eliot Lee