You may need to do some work on your tables in the display portion. I think you may be missing some closing </table> tags or something. When I looked at your site with Netscape, the database home page was blank. (Netscape is less forgiving about closing tags than Internet Explorer is.)
I started to write a tutorial on how to customize the html_record_form subroutine, but I've been at it for quite a while and I'm still not finished. I was trying to explain all of the Perl stuff at the same time as I told you how to do things. It's just a little too complex to do all at once.
So, rather than overwhelm you with details, the best thing I can suggest is to follow the patterns in sub html_record_form. For each field you will need to know
(A) -- the label you want your users to see
(B) -- the field name --
exactly as it is in the .cfg file. Letter case counts!
(C) -- the field length as defined in your .cfg file
(D) -- the max length as defined in your .cfg file
I'll reference these letters in the patterns below.
For hidden fields (ones which have the field length set to -1), use
Code:
<input type="hidden" name="
B" value="$rec{'
B'}">
For text fields, use
Code:
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>
A:</FONT></TD>
<TD VALIGN="TOP"> <INPUT TYPE="TEXT" NAME="
B"
VALUE="$rec{'
B'}" SIZE="
C" MAXLENGTH="
D"></TD></TR>
For select fields -- ones that you have defined in %db_select_fields in the .cfg file-- use
Code:
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>
A: </FONT></TD>
<TD VALIGN="TOP"> |; print &build_select_field ("
B", "$rec{'
B'}"); print qq|</TD></TR>
Text area fields are a little different. You would have defined their field length as something like '40x3'. I'll refer to the number of columns as
C1 and the number of rows as
C2.
Code:
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>
A</FONT></TD>
<TD VALIGN="TOP"> <TEXTAREA NAME="
B" ROWS="
C2" COLS="
C1"
WRAP="VIRTUAL" MAXLENGTH="
D">$rec{'
B'}</TEXTAREA></TD></TR>
You aren't using any radio fields or checkbox fields, but I'll put them in anyway in case someone else is following along.
To make a checkbox field:
Code:
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>
A: </FONT></TD>
<TD VALIGN="TOP"> |; print &build_checkbox_field ("
B", "$rec{'
B'}"); print qq|</TD></TR>
To make a radio field:
Code:
<TR><TD ALIGN="Right" VALIGN="TOP"><$font>
A: </FONT></TD>
<TD VALIGN="TOP"> |; print &build_radio_field ("
B", "$rec{'
B'}"); print qq|</TD></TR>
Leave $db_auto_generate set to 1 in your .cfg file (because you haven't defined your display yet) and put a # in front of the second "real" line in html_record_form, so it looks like
Code:
# ($db_auto_generate and print &build_html_record_form(%rec) and return);
Then upload the file and test it out.
I'll tell you more about things like "admin only" fields after you get this done.
Regarding the get_defaults subroutine, it is in the db.cgi script. But you shouldn't have to alter it. You can define default values directly in the .cfg file. If you don't understand how, just ask.
------------------
JPD
[This message has been edited by JPDeni (edited June 29, 1999).]