Esteemed Monks,

We recently upgraded many of our Perl modules, including CGI.pm. We then noticed that the tab order in our forms had gone completely crazy. Focus jumped all over the place.

I did a little research, and sitting there in the list of changes for CGI.pm for version 3.06 is the innocent looking:

   12. Support for tab indexes.

It appears that CGI.pm now puts tabindex numbers in for all form elements it creates. My problem is that we often create forms that mix HTML and CGI generated form elemenets (in Template Toolkit, for example).

One fix is to always use CGI.pm's methods to create form elements. Another is to never use them. A really bad solution is to try to set tab index around them. I don't really like any of these solutions. Any other suggestions on a work-around?

Also, has anyone else run into this? Should I suggest a pragma to turn this off again? Thanks.

Update: The workaround suggested below to use the -no_xhtml pragma only works for some CGI generated HTML. Some form elements will output the tabindex with xhtml activated or not.

Update:This has been fixed in the newest version of the CGI module. The tabindex feature is now an option and you must explicitly turn it on to make it work. The default behavior is now as it was before. Thanks to Lincoln Stein for fixing this.


In reply to Tab index feature added to CGI.pm by cbrandtbuffalo

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.