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?


In reply to Re^5: CGI.pm and tabindex by dirving
in thread CGI.pm and tabindex by ruzam

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.