in reply to Re^4: CGI.pm and tabindex
in thread CGI.pm and tabindex

Read CGI.pm a little closer :) Tabindex will only get added if $XHTML is true, but it won't necessarily get added -- even though from looking at just the line  return $XHTML ? qq(<input type="$tag" name="$name" $tabindex$value$s$m$other />) this seems to be the case, if look you up a few lines, $tabindex gets set by calling the element_tab method, which returns an empty string unless -tabindex was passed at some point. So it looks like you can use the -no_xhtml switch to work around this, but there is still something strange going on.

If I had to guess, I'd say that tabindex was added to the HTML standard when XHTML came out, which is why it does this. XHTML should probably be the default since it is the most current standard, although if you decide to use HTML4 or whatever there is nothing inherently wrong with that.

Out of curiosity, what version of CGI.pm do you have? I'm looking at 3.15 here... it's possible we're looking at totally different things. Also, did you try the two one-liners I suggested -- and if you did, what were the results?

Replies are listed 'Best First'.
Re^6: CGI.pm and tabindex
by ruzam (Curate) on Sep 03, 2006 at 17:05 UTC
    Sorry, should have got back to the list sooner. Turns out this is a previously identified bug in CGI.pm Tab index feature added to CGI.pm

    I've got version 3.08 installed.