Uppercase any lowercase zipcode letters entered. Fixes 11018.

This commit is contained in:
Colin Kuskie 2009-09-24 09:31:42 -07:00
parent 532f8ece6b
commit 6a3d1588be
3 changed files with 5 additions and 2 deletions

View file

@ -6,6 +6,7 @@
- fixed #11031: AssetProxy refering to trash-limbo asset
- fixed #11028: IOB: Not choosing status causes Problem With Request
- fixed #11029: enableStreamingUploads
- fixed #11018: no lowercase typing possible in addressbook
7.8.0
- upgraded YUI to 2.8.0r4

View file

@ -82,6 +82,7 @@ sub getName {
=head2 getValue ( [ value ] )
Returns a validated form post result. If the result does not pass validation, it returns undef instead.
Uppercases any lowercase letters.
=head3 value
@ -93,6 +94,7 @@ sub getValue {
my $self = shift;
my $value = $self->SUPER::getValue(@_);
$value =~ tr/\r\n//d;
$value =~ tr/a-z/A-Z/d;
if ($value =~ /^[A-Z\d\s\-]+$/) {
return $value;
}
@ -122,7 +124,7 @@ Renders a zip code field.
sub toHtml {
my $self = shift;
$self->session->style->setScript($self->session->url->extras('inputCheck.js'),{ type=>'text/javascript' });
$self->set("extras", $self->get('extras') . ' onkeyup="doInputCheck(document.getElementById(\''.$self->get("id").'\'),\'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ- \')"');
$self->set("extras", $self->get('extras') . ' onkeyup="doInputCheck(document.getElementById(\''.$self->get("id").'\'),\'0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz- \')"');
return $self->SUPER::toHtml;
}

View file

@ -55,7 +55,7 @@ my $testBlock = [
{
key => 'Zip5',
testValue => 'abcde',
expected => undef,
expected => 'ABCDE',
comment => 'lower case',
},
];