Gossamer Forum
Home : Products : DBMan SQL : Discussion :

Re: Dynamic Pull Down

Quote Reply
Re: Dynamic Pull Down In reply to
I didn't find the thread Eliot pointed to by using his search terms, so I'll tell you what I did.

In sub html_record_form, I have:

Code:

<TR><TD align=right valign=top><$font>Category:</font></td>
<TD>|; print &build_select_field_from_db("Category",$rec{'Category'});
if ($per_admin) {
print qq|<BR><input type=text name="Category" size="20" maxlength="255">
&nbsp;&nbsp;<$font>Add a new category</font></td></tr>|;
}
print qq|
You'll also need to make a change in sub validate_record. Add the code in red below:

Code:

foreach $col (@db_cols) {
$in{$col} =~ s/^~~//;
$in{$col} =~ s/~~$//;

if ($in{$col} =~ /^\s*$/) { # entry is null or only whitespace
if ($db_not_null{$col}) { # entry is not allowed to be null.
push(@input_err, "$col (Can't be Blank)"); # so let's add it as an error
}
}
If you don't add those lines, you'll end up with a ~~ at either the beginning or end of your field entry.

JPD
http://www.jpdeni.com/dbman/
Subject Author Views Date
Thread Dynamic Pull Down cheresources 3518 Jul 23, 2000, 5:34 PM
Thread Re: Dynamic Pull Down
Stealth 3418 Jul 23, 2000, 6:33 PM
Thread Re: Dynamic Pull Down
cheresources 3387 Jul 24, 2000, 5:00 PM
Post Re: Dynamic Pull Down
Stealth 3389 Jul 24, 2000, 8:46 PM
Post Re: Dynamic Pull Down
JPDeni 3385 Jul 25, 2000, 1:30 AM