Subject: | disabled textvield throws exception on submit; checkbox validation get wrong parameters |
If a textfield has attribute or subtag "disabled" ist is correctly
flagged disabled, but when a submit button is pressed an exception
is thrown.
If a checkbox is given an index attribute and the box is NOT checked,
the index value is given as the second argument to the validate_
function. If it is checked the value is correctly assigned, and
the index is given as third parameter...
Both errors seem to be a problem with the get method of Apache::Table
which does not return an array at all if the requested parameter
is not returned by the browser.
So code like this fails:
textfield => {
...
value => ($params->get($name.$index))[-1],
...
}
I repleaced
$params->get($name.$index))[-1]
by
$params->get($name.$index))[-1] || undef
at two places and the above errors disappeared.
I have not enough inside knowledge of PerForm.pm if this should
be done to all other occurences of such code.
I added a patch showing my changes
Bye, Peter
Elimpex
Versions used:
PerForm 1.83 # $Id: PerForm.pm,v 1.24 2003/08/10 16:43:56 matt Exp $
perl -v: This is perl, v5.8.0 built for i586-linux-thread-multi