No syntax errors!!
I know that you want to hide some of the fields for your search form, but right now we're worrying about the form for entering and modifying the data. We'll get to the rest in just a bit.
You need to delete
<input type="hidden" name="Store Name" value="$rec{'Store Name'}">
<input type="hidden" name="Store Description" value="$rec{'Store Description'}">
<input type="hidden" name="URL" value="$rec{'URL'}">
and
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>ID:</font></TD>
<TD VALIGN="TOP">
<input type="text" name="ID" value="$rec{'ID'}" size="40" maxlength="255"></TD></TR>
You can't have two fields, even hidden ones that have the same name within a form. (Well, you can, but it's a really bad idea.
)
Now here's where you build your checkbox fields.
Go into your default.cfg file and add the following:
Code:
%Categories = (
Room => 'Bathroom Bedroom Childrens Diningroom HomeOffice Kitchen LivingRoom OutdoorLiving',
Style => 'Antiques Arts Asian Biedermeier Consignment Contemporary Country Custom European Fine Ironwork
Leather Mexican MidCentury Reproduction World',
Item => 'Accessories Appliances Armoire Art Beds Chairs Children Desks Fabrics Flooring
Hardware Lighting Outdoor Paint Sofas Sinks Tables1 Tables2 Tabletop Tiles'
);
I put linefeeds in there so things wouldn't scroll too much, but you need to keep all the field names for each of the categories on one line. You should end up with just 3 lines of real text.
The purpose of this is to be able to group your fields together.
Every one of your checkbox fields should be listed there. If you've added any more, just put the name of the field into the correct category.
Then go back to the html.pl file, sub html_record.
You would have already deleted the extra fields I mentioned above.
After
Code:
<input type="text" name="URL" value="$rec{'URL'}" size="40" maxlength="255"></TD></TR>
add
Code:
<tr><td colspan=2>
<table width=100%>|;
foreach $category (sort keys %Categories) {
$i = 0;
print qq|<tr><td colspan=3>
<font face="Arial, Helvetica, sans-serif" size="2" color="#000099"><B>By $category</b></font></td></tr>\n|;
@array = split (/ /, $Categories{$category});
foreach $item (sort @array) {
unless ($i%3) {
print "<tr>";
}
print qq|<td><font face="Arial, Helvetica, sans-serif" size="1" color="#000000">|;
print &build_checkbox_field($item,$rec{$item});
print "</font></td>\n";
if ($i%3 == 2) {
print "</tr>\n";
}
++$i;
}
while ($i%3 > 1) {
print "<td> </td>\n";
++$i;
}
print "</tr><tr><td colspan=3> </td></tr>";
}
print "</table></td></tr>";
print qq|
That will give you your checkboxes.
Once you're done with that, we'll work on the search form. It'll be a piece o' cake!
------------------
JPD
[This message has been edited by JPDeni (edited August 27, 1999).]
[This message has been edited by JPDeni (edited August 27, 1999).]