Gossamer Forum
Home : Products : DBMan : Installation :

Category Blank - Checked other posts

Quote Reply
Category Blank - Checked other posts
Well i seem to have the same problem of the category field coming out blank.

Could you please tell me where in the code specifies stuff like this ?

sub html_record {
# --------------------------------------------------------
# How a record will be displayed. This is used primarily in
# returning search results and how it is formatted. The record to
# be displayed will be in the %rec hash.

my (%rec) = @_; # Load any defaults to put in the VALUE field.
($db_auto_generate and print &build_html_record(%rec) and return);

my $font_color = 'Font face="Verdana, Arial, Helvetica" Size=2 Color=#003399';
my $font = 'Font face="Verdana, Arial, Helvetica" Size=2';

print qq|
<TABLE WIDTH="475" CELLPADDING=0 CELLSPACING=0 BORDER=1 BGCOLOR="#0099FF">
<TR><TD ALIGN="Right" VALIGN="TOP" WIDTH="20%"><$font_color>ID:</FONT></TD>
<TD WIDTH="80%"> <$font>$rec{'ID'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>FirstName:</FONT></TD>
<TD> <$font>$rec{'FirstName'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>LastName:</FONT></TD>
<TD> <$font>$rec{'LastName'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>City:</FONT></TD>
<TD> <$font>$rec{'City'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Email:</FONT></TD>
<TD> <$font>$rec{'Email'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>ICQ:</FONT></TD>
<TD> <$font>$rec{'ICQ'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>HomePage:</FONT></TD>
<TD> <$font><A HREF="$rec{'HomePage'}" TARGET="_blank"">$rec{'HomePage'}</A></Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Category:</FONT></TD>
<TD> <$font>$rec{'Category'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Phone:</FONT></TD>
<TD> <$font>$rec{'Phone'}</Font></TD></TR>
<TR><TD ALIGN="Right" VALIGN="TOP"><$font_color>Other:</FONT></TD>
<TD> <$font>$rec{'Other'}</Font></TD></TR>
</TABLE>
|;


I believe this is where you mark what u want to be able to see.

Quote Reply
Re: Category Blank - Checked other posts In reply to
Assuming this is a select field and your selection are defined in your .cfg file.

In your html_record_form do you have the category field setup like this:

<TR><TD><$font><B>Category:</B></FONT></TD><TD>|; print &build_select_field("Category",$rec{'Category'}); print qq|</TD></TR>

Also where you have your category choices defined in your .cfg file be sure there are no spaces between them such as:

'Category' => 'Choice 1,Choice 2,Choice 3'

If you have spaces in your selection field names you may want to include the following within your .cgi file. It may help if you decide to use other mods relating to select fields:

sub urlencode {
# --------------------------------------------------------
# Escapes a string to make it suitable for printing as a URL.
#
my($toencode) = shift;
$toencode =~ s/([^a-zA-Z0-9_\-.])/uc sprintf("%%x",ord($1))/eg;
return $toencode;
}

Hope this helps

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/
Quote Reply
Re: Category Blank - Checked other posts In reply to
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>Category:</FONT></TD>
<TD VALIGN="TOP"> |; print &build_select_field ("Category", "$rec{'Category'}"); print qq|</TD></TR>

I believe thats fine

The category names have no spaces within them or seperating them.

Any other ideas ?


Quote Reply
Re: Category Blank - Checked other posts In reply to
Without seeing a .txt version of your files it's hard to guess what may be causing the problem .. but after looking at what you posted again I noticed:

<A HREF="$rec{'HomePage'}" TARGET="_blank"">$rec{'HomePage'}</A>

Since this is the field prior to listing your category and you do have an extra " after blank .. i'm thinking perhaps that might be causing problems? It's funny, but something as simple as that type of errors can cause all kinds of problems.

Unoffical DBMan FAQ
http://webmagic.hypermart.net/dbman/