Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Old Version fixes and change logs (http://forum.bytesforall.com/forumdisplay.php?f=37)
-   -   BUGFIX 361-02: Tab order on comment form incorrect when user is not logged in (http://forum.bytesforall.com/showthread.php?t=12208)

juggledad Jan 13, 2011 04:37 AM

BUGFIX 361-02: Tab order on comment form incorrect when user is not logged in
 
1 Attachment(s)
If a user is not logged in, then the tab order of the comment form fields is incorrect. To fix this issue, edit comments.php and change lines 93-101 from

HTML Code:

// author, email and url fields are set in a separate variable first:
$fields =  array(
        'author' => '<p><input class="text author" id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' tabindex="1" />' .
                                '&nbsp;&nbsp;<label for="author"><strong>' . __( 'Name' ) . '</strong> ' . ( $req ? __('(required)','atahualpa') : '' ) . '</label></p>',
        'email'  => '<p><input class="text email" id="email" name="email" type="text" value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . ' />' .
                                '&nbsp;&nbsp;<label for="email"><strong>' . __( 'Email' ) . '</strong> ' . ( $req ? __('(will not be published) (required)','atahualpa') : '' ) . '</label></p>',
        'url'    => '<p><input class="text url" id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30" />' .
                                '&nbsp;&nbsp;<label for="url">' . __( 'Website' ) . '</label></p>'
);

to
HTML Code:

// author, email and url fields are set in a separate variable first:
$fields =  array(
        'author' => '<p><input class="text author" id="author" name="author" type="text" value="' . esc_attr( $commenter['comment_author'] ) . '" size="30"' . $aria_req . ' tabindex="1" />' .
                                '&nbsp;&nbsp;<label for="author"><strong>' . __( 'Name' ) . '</strong> ' . ( $req ? __('(required)','atahualpa') : '' ) . '</label></p>',
        'email'  => '<p><input class="text email" id="email" name="email" type="text" value="' . esc_attr(  $commenter['comment_author_email'] ) . '" size="30"' . $aria_req . '  tabindex="2" />' .
                                '&nbsp;&nbsp;<label for="email"><strong>' . __( 'Email' ) . '</strong> ' . ( $req ? __('(will not be published) (required)','atahualpa') : '' ) . '</label></p>',
        'url'    => '<p><input class="text url" id="url" name="url" type="text" value="' . esc_attr( $commenter['comment_author_url'] ) . '" size="30"  tabindex="3" />' .
                                '&nbsp;&nbsp;<label for="url">' . __( 'Website' ) . '</label></p>'
);

or you can use the attached file which has the changes already applied. Download the file, unzip it and upload it to your Atahualpa 3.6.1 theme folder.
Attachment 1032

Linoge Feb 25, 2011 03:38 PM

I hate to be the bearer of bad news, but this fix does not appear to be working, even when I am logged in. Pressing "Tab" from the comment form takes the highlight up to the first link on the page, and never seems to get back around to the "Submit" button.

juggledad Feb 25, 2011 04:27 PM

Without this fix you would jump from the 'Name' to the 'Message Text' to the top of the document to possibly other places then finally to the 'Email' then Website.

the actual Comment form is built with a WordPress function and that code puts no tabindex on the submit button.

If you want, you can edit 'comment-template.php' which is in the 'wordpress/includes' folder and find line 1577 (in WP 3.0.5) which should be
HTML Code:

                                                        <input name="submit" type="submit" id="<?php echo esc_attr( $args['id_submit'] ); ?>" value="<?php echo esc_attr( $args['label_submit'] ); ?>" />
and change it to
HTML Code:

                                                        <input name="submit" type="submit" id="<?php echo esc_attr( $args['id_submit'] ); ?>" tabindex="5"  value="<?php echo esc_attr( $args['label_submit'] ); ?>" />
and that will add a tab to the Submit button.

Linoge Feb 26, 2011 07:26 AM

Well, in that case, cancel my complaints and thanks for the pointer!


All times are GMT -6. The time now is 11:36 PM.

Powered by vBulletin® Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.