added automatic id attribute generation to all form controls
This commit is contained in:
parent
3058d839c0
commit
4c8ff049cc
29 changed files with 116 additions and 25 deletions
|
|
@ -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}.' />';
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue