Gossamer Forum
Home : Products : DBMan : Customization :

custom html_record_form

Quote Reply
custom html_record_form
i'm trying to customize my html_record_form for a particular database and think maybe it's a complicated perl issue. see my post in the perl forum for details. if you have any suggestions, please let me know.
Quote Reply
Re: [delicia] custom html_record_form In reply to
i've been doing more research and it seems like i should be able to use :
Code:

<INPUT TYPE="CHECKBOX" NAME="Preference" VALUE="Pre-planning" CHECKED><INPUT TYPE="CHECKBOX" NAME="Preference" VALUE="Setup"><INPUT TYPE="CHECKBOX" NAME="Preference" VALUE="Removal" CHECKED>

in my form, i.e. use the same fieldname Preference for all the checkboxes. shouldn't sub parse_form gather all the checked items and put the ~~ between them automatically?
Code:

sub parse_form {my (%in);
my ($buffer, $pair, $name, $value);
PAIR: foreach $name ($query->param()) {
@value = $query->param("$name");
$value = join '~~', @value;

$name =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
if ($value eq "---") { next PAIR; }
if ($value eq "http://") { next PAIR; } # Removes default beginning of URLs
unless ($value) { next PAIR; }
$in{$name} = $value;
}
return %in;
}

i am able to read the existing record correctly for each value to determine whether CHECKED should be in the input line.

however when i make any change to the record, it says Preference is blank (required field error). but on the form it still shows the checkmarks properly. i don't understand why it's wiping out the value of Preference.
Quote Reply
Re: [delicia] custom html_record_form In reply to
never mind. i forgot about the code i put in sub modify_record. that was messing it up.