Permalink
Browse files

Fixed tabindex="0" when using CGI to create forms without a prior sta…

…rt_html
  • Loading branch information...
1 parent bef2381 commit 5999bb98daeaae4cb2f909cfc74f7fa2a0e2c11e lstein committed May 5, 2005
Showing with 24 additions and 18 deletions.
  1. +4 −3 CGI.pm
  2. +4 −0 Changes
  3. +1 −0 MANIFEST
  4. +15 −15 t/form.t
View
7 CGI.pm
@@ -18,8 +18,8 @@ use Carp 'croak';
# The most recent version and complete docs are available at:
# http://stein.cshl.org/WWW/software/CGI/
-$CGI::revision = '$Id: CGI.pm,v 1.179 2005-04-07 22:40:37 lstein Exp $';
-$CGI::VERSION=3.08;
+$CGI::revision = '$Id: CGI.pm,v 1.180 2005-05-05 20:15:35 lstein Exp $';
+$CGI::VERSION=3.09;
# HARD-CODED LOCATION FOR FILE UPLOAD TEMPORARY FILES.
# UNCOMMENT THIS ONLY IF YOU KNOW WHAT YOU'RE DOING.
@@ -179,7 +179,7 @@ $IIS++ if defined($ENV{'SERVER_SOFTWARE'}) && $ENV{'SERVER_SOFTWARE'}=~/IIS/;
if (exists $ENV{MOD_PERL}) {
# mod_perl handlers may run system() on scripts using CGI.pm;
# Make sure so we don't get fooled by inherited $ENV{MOD_PERL}
- if ($ENV{MOD_PERL_API_VERSION} == 2) {
+ if (exists $ENV{MOD_PERL_API_VERSION} && $ENV{MOD_PERL_API_VERSION} == 2) {
$MOD_PERL = 2;
require Apache2::Response;
require Apache2::RequestRec;
@@ -888,6 +888,7 @@ sub element_id {
sub element_tab {
my ($self,$new_value) = self_or_default(@_);
+ $self->{'.etab'} ||= 1;
$self->{'.etab'} = $new_value if defined $new_value;
$self->{'.etab'}++;
}
View
@@ -1,3 +1,7 @@
+ Version 3.09
+ 1. Fixed tabindex="0" when using CGI to create forms without a prior start_html
+ 2. Removed warning about non-numeric MOD_PERL_API_VERSION.
+
Version 3.08
1. update support for mod_perl 2.0. versions prior to
mod_perl 1.999_22 (2.0.0-RC5) are no longer supported.
View
@@ -53,3 +53,4 @@ t/request.t
t/switch.t
t/util.t
t/util-58.t
+META.yml Module meta-data (added by MakeMaker)
View
@@ -33,85 +33,85 @@ is(start_form(-action=>'foobar',-method=>'get'),
"start_form()");
is(submit(),
- qq(<input type="submit" tabindex="0" name=".submit" />),
+ qq(<input type="submit" tabindex="1" name=".submit" />),
"submit()");
is(submit(-name => 'foo',
-value => 'bar'),
- qq(<input type="submit" tabindex="1" name="foo" value="bar" />),
+ qq(<input type="submit" tabindex="2" name="foo" value="bar" />),
"submit(-name,-value)");
is(submit({-name => 'foo',
-value => 'bar'}),
- qq(<input type="submit" tabindex="2" name="foo" value="bar" />),
+ qq(<input type="submit" tabindex="3" name="foo" value="bar" />),
"submit({-name,-value})");
is(textfield(-name => 'weather'),
- qq(<input type="text" name="weather" tabindex="3" value="dull" />),
+ qq(<input type="text" name="weather" tabindex="4" value="dull" />),
"textfield({-name})");
is(textfield(-name => 'weather',
-value => 'nice'),
- qq(<input type="text" name="weather" tabindex="4" value="dull" />),
+ qq(<input type="text" name="weather" tabindex="5" value="dull" />),
"textfield({-name,-value})");
is(textfield(-name => 'weather',
-value => 'nice',
-override => 1),
- qq(<input type="text" name="weather" tabindex="5" value="nice" />),
+ qq(<input type="text" name="weather" tabindex="6" value="nice" />),
"textfield({-name,-value,-override})");
is(checkbox(-name => 'weather',
-value => 'nice'),
- qq(<label><input type="checkbox" name="weather" value="nice" tabindex="6" />weather</label>),
+ qq(<label><input type="checkbox" name="weather" value="nice" tabindex="7" />weather</label>),
"checkbox()");
is(checkbox(-name => 'weather',
-value => 'nice',
-label => 'forecast'),
- qq(<label><input type="checkbox" name="weather" value="nice" tabindex="7" />forecast</label>),
+ qq(<label><input type="checkbox" name="weather" value="nice" tabindex="8" />forecast</label>),
"checkbox()");
is(checkbox(-name => 'weather',
-value => 'nice',
-label => 'forecast',
-checked => 1,
-override => 1),
- qq(<label><input type="checkbox" name="weather" value="nice" tabindex="8" checked="checked" />forecast</label>),
+ qq(<label><input type="checkbox" name="weather" value="nice" tabindex="9" checked="checked" />forecast</label>),
"checkbox()");
is(checkbox(-name => 'weather',
-value => 'dull',
-label => 'forecast'),
- qq(<label><input type="checkbox" name="weather" value="dull" tabindex="9" checked="checked" />forecast</label>),
+ qq(<label><input type="checkbox" name="weather" value="dull" tabindex="10" checked="checked" />forecast</label>),
"checkbox()");
is(radio_group(-name => 'game'),
- qq(<label><input type="radio" name="game" value="chess" checked="checked" tabindex="10" />chess</label> <label><input type="radio" name="game" value="checkers" tabindex="11" />checkers</label>),
+ qq(<label><input type="radio" name="game" value="chess" checked="checked" tabindex="11" />chess</label> <label><input type="radio" name="game" value="checkers" tabindex="12" />checkers</label>),
'radio_group()');
is(radio_group(-name => 'game',
-labels => {'chess' => 'ping pong'}),
- qq(<label><input type="radio" name="game" value="chess" checked="checked" tabindex="12" />ping pong</label> <label><input type="radio" name="game" value="checkers" tabindex="13" />checkers</label>),
+ qq(<label><input type="radio" name="game" value="chess" checked="checked" tabindex="13" />ping pong</label> <label><input type="radio" name="game" value="checkers" tabindex="14" />checkers</label>),
'radio_group()');
is(checkbox_group(-name => 'game',
-Values => [qw/checkers chess cribbage/]),
- qq(<label><input type="checkbox" name="game" value="checkers" checked="checked" tabindex="14" />checkers</label> <label><input type="checkbox" name="game" value="chess" checked="checked" tabindex="15" />chess</label> <label><input type="checkbox" name="game" value="cribbage" tabindex="16" />cribbage</label>),
+ qq(<label><input type="checkbox" name="game" value="checkers" checked="checked" tabindex="15" />checkers</label> <label><input type="checkbox" name="game" value="chess" checked="checked" tabindex="16" />chess</label> <label><input type="checkbox" name="game" value="cribbage" tabindex="17" />cribbage</label>),
'checkbox_group()');
is(checkbox_group(-name => 'game',
'-values' => [qw/checkers chess cribbage/],
'-defaults' => ['cribbage'],
-override=>1),
- qq(<label><input type="checkbox" name="game" value="checkers" tabindex="17" />checkers</label> <label><input type="checkbox" name="game" value="chess" tabindex="18" />chess</label> <label><input type="checkbox" name="game" value="cribbage" checked="checked" tabindex="19" />cribbage</label>),
+ qq(<label><input type="checkbox" name="game" value="checkers" tabindex="18" />checkers</label> <label><input type="checkbox" name="game" value="chess" tabindex="19" />chess</label> <label><input type="checkbox" name="game" value="cribbage" checked="checked" tabindex="20" />cribbage</label>),
'checkbox_group()');
is(popup_menu(-name => 'game',
'-values' => [qw/checkers chess cribbage/],
-default => 'cribbage',
-override => 1),
- '<select name="game" tabindex="20">
+ '<select name="game" tabindex="21">
<option value="checkers">checkers</option>
<option value="chess">chess</option>
<option selected="selected" value="cribbage">cribbage</option>

0 comments on commit 5999bb9

Please sign in to comment.