added automatic id attribute generation to all form controls

This commit is contained in:
JT Smith 2005-07-28 22:53:24 +00:00
parent 3058d839c0
commit 4c8ff049cc
29 changed files with 116 additions and 25 deletions

View file

@ -72,6 +72,18 @@ sub definition {
}
#-------------------------------------------------------------------
=head2 generateIdParameter ( )
A class method that returns a value to be used as the autogenerated ID for this field instance. Returns undef because this field type can have more than one with the same name, therefore autogenerated ID's aren't terribly useful.
=cut
sub generateIdParameter {
return undef
}
#-------------------------------------------------------------------
=head2 getName ()
@ -97,7 +109,8 @@ sub toHtml {
my $self = shift;
my $value = $self->fixMacros($self->fixQuotes($self->fixSpecialCharacters($self->{value})));
my $checkedText = ' checked="checked"' if ($self->{checked});
return '<input type="checkbox" name="'.$self->{name}.'" value="'.$value.'"'.$checkedText.' '.$self->{extras}.' />';
my $idText = ' id="'.$self->{id}.'" ' if ($self->{id});
return '<input type="checkbox" name="'.$self->{name}.'" value="'.$value.'"'.$idText.$checkedText.' '.$self->{extras}.' />';
}