Browse Source

Respect tabindex for required fields at registration...a bit ugly but works

Signed-off-by: emanuele <[email protected]>
emanuele 12 years ago
parent
commit
c0db140a13
1 changed files with 5 additions and 1 deletions
  1. 5 1
      Themes/default/Register.template.php

+ 5 - 1
Themes/default/Register.template.php

@@ -184,7 +184,11 @@ function template_registration_form()
 							<strong', !empty($field['is_error']) ? ' style="color: red;"' : '', '>', $field['name'], ':</strong>
 							<span class="smalltext">', $field['desc'], '</span>
 						</dt>
-						<dd>', $field['input_html'], '</dd>';
+						<dd>', preg_replace_callback('~<(input|select|textarea) ~', create_function('$matches', '
+							global $context;
+							return \'<\' . $matches[1] . \' tabindex="\' . $context[\'tabindex\']++ . \'"\';
+						')
+					, $field['input_html']), '</dd>';
 
 		echo '
 					</dl>';