View Issue Details

IDProjectCategoryView StatusLast Update
0003460mantisbtcustom fieldspublic2016-08-18 03:10
Reportervboctor Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status newResolutionopen 
Summary0003460: Custom Fields tab sequence
Description

This issue was reported by rabbe.kurten@rkrealtidssystem.com on online manual custom fields page:

"I can get the custom fields ordered between themselves OK, but how do I get them into the ordinary tab sequence. When I press the tab key within a custom field I jump somewhere into one of the ordinary fields depending on where I was before going into the custom field. Is there a solution to this problem?
Rabbe Kurtén, Stockholm"

Tagspatch

Relationships

has duplicate 0006167 closeddregad The tab order of "Custom fields" is not usable 
has duplicate 0010800 closeddregad Tabindex of "custom-fields" in "bug_change_status_page.php" contra no tab-order in original mantisbt-fields 

Activities

vboctor

vboctor

2003-12-18 22:23

manager   ~0004833

I have tested this on IE 6 and Mantis 0.18.0rc1 and it seems to be fine. Can you tell me more about the environment?

cbh

cbh

2004-02-25 10:07

reporter   ~0005112

It works fine when editing an existing bug, but when entering a new bug the fields are quite hard to get to with the tab key as they are at a very weird place in the tab order.
Mozilla 1.6, Windows XP, Mantis 0.18.1

2004-02-28 17:22

 

mantis-3460.diff (8,163 bytes)   
Index: bug_report_advanced_page.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/bug_report_advanced_page.php,v
retrieving revision 1.31
diff -u -r1.31 bug_report_advanced_page.php
--- bug_report_advanced_page.php	11 Jan 2004 07:16:06 -0000	1.31
+++ bug_report_advanced_page.php	28 Feb 2004 22:02:46 -0000
@@ -300,6 +300,7 @@
 <!-- Custom Fields -->
 <?php
 	$t_custom_fields_found = false;
+	$custom_fields_count = 0;
 	$t_related_custom_field_ids = custom_field_get_linked_ids( $t_project_id );
 
 	foreach( $t_related_custom_field_ids as $t_id ) {
@@ -308,6 +309,7 @@
 		}
 
 		$t_custom_fields_found = true;
+		$custom_fields_count++;
 		$t_def = custom_field_get_definition( $t_id );
 ?>
 <tr <?php echo helper_alternate_class() ?>>
@@ -315,7 +317,7 @@
 		<?php echo lang_get_defaulted( $t_def['name'] ) ?>
 	</td>
 	<td>
-		<?php print_custom_field_input( $t_def ) ?>
+		<?php print_custom_field_input( $t_def, null, $custom_fields_count+15 ) ?>
 	</td>
 </tr>
 <?php
@@ -339,7 +341,7 @@
 	</td>
 	<td>
 		<input type="hidden" name="max_file_size" value="<?php echo config_get( 'max_file_size' ) ?>" />
-		<input tabindex="16" name="file" type="file" size="60" />
+		<input tabindex="<?php echo $custom_fields_count+16 ?>" name="file" type="file" size="60" />
 	</td>
 </tr>
 <?php } ?>
@@ -351,8 +353,8 @@
 		<?php echo lang_get( 'view_status' ) ?>
 	</td>
 	<td>
-		<input tabindex="17" type="radio" name="view_state" value="<?php echo VS_PUBLIC ?>" <?php check_checked( $f_view_state, VS_PUBLIC ) ?> /> <?php echo lang_get( 'public' ) ?>
-		<input tabindex="18" type="radio" name="view_state" value="<?php echo VS_PRIVATE ?>" <?php check_checked( $f_view_state, VS_PRIVATE ) ?> /> <?php echo lang_get( 'private' ) ?>
+		<input tabindex="<?php echo $custom_fields_count+17>" type="radio" name="view_state" value="<?php echo VS_PUBLIC ?>" <?php check_checked( $f_view_state, VS_PUBLIC ) ?> /> <?php echo lang_get( 'public' ) ?>
+		<input tabindex="<?php echo $custom_fields_count+18>" type="radio" name="view_state" value="<?php echo VS_PRIVATE ?>" <?php check_checked( $f_view_state, VS_PRIVATE ) ?> /> <?php echo lang_get( 'private' ) ?>
 	</td>
 </tr>
 
@@ -363,7 +365,7 @@
 		<?php echo lang_get( 'report_stay' ) ?> <?php print_documentation_link( 'report_stay' ) ?>
 	</td>
 	<td>
-		<input tabindex="19" type="checkbox" name="report_stay" <?php check_checked( $f_report_stay ) ?> /> (<?php echo lang_get( 'check_report_more_bugs' ) ?>)
+		<input tabindex="<?php echo $custom_fields_count+19 ?>" type="checkbox" name="report_stay" <?php check_checked( $f_report_stay ) ?> /> (<?php echo lang_get( 'check_report_more_bugs' ) ?>)
 	</td>
 </tr>
 
@@ -374,7 +376,7 @@
 		<span class="required"> * <?php echo lang_get( 'required' ) ?></span>
 	</td>
 	<td class="center">
-		<input tabindex="20" type="submit" value="<?php echo lang_get( 'submit_report_button' ) ?>" />
+		<input tabindex="<?php echo $custom_fields_count+20 ?>" type="submit" value="<?php echo lang_get( 'submit_report_button' ) ?>" />
 	</td>
 </tr>
 
Index: bug_report_page.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/bug_report_page.php,v
retrieving revision 1.31
diff -u -r1.31 bug_report_page.php
--- bug_report_page.php	5 Feb 2004 10:57:01 -0000	1.31
+++ bug_report_page.php	28 Feb 2004 22:02:46 -0000
@@ -173,19 +173,21 @@
 <!-- Custom Fields -->
 <?php
 	$t_custom_fields_found = false;
+	$custom_fields_count = 0;
 	$t_related_custom_field_ids = custom_field_get_linked_ids( $t_project_id );
 
 	foreach( $t_related_custom_field_ids as $t_id ) {
 		$t_def = custom_field_get_definition( $t_id );
 		if( !$t_def['advanced'] && custom_field_has_write_access_to_project( $t_id, $t_project_id ) ) {
 			$t_custom_fields_found = true;
+			$custom_fields_count++;
 ?>
 <tr <?php echo helper_alternate_class() ?>>
 	<td class="category">
 		<?php echo lang_get_defaulted( $t_def['name'] ) ?>
 	</td>
 	<td>
-		<?php print_custom_field_input( $t_def ) ?>
+		<?php print_custom_field_input( $t_def, null, $custom_fields_count+7 ) ?>
 	</td>
 </tr>
 <?php
@@ -210,7 +212,7 @@
 	</td>
 	<td>
 		<input type="hidden" name="max_file_size" value="<?php echo config_get( 'max_file_size' ) ?>" />
-		<input tabindex="8" name="file" type="file" size="60" />
+		<input tabindex="<?php echo $custom_fields_count+8 ?>" name="file" type="file" size="60" />
 	</td>
 </tr>
 <?php } ?>
@@ -222,8 +224,8 @@
 		<?php echo lang_get( 'view_status' ) ?>
 	</td>
 	<td>
-		<input tabindex="9" type="radio" name="view_state" value="<?php echo VS_PUBLIC ?>" <?php check_checked( $f_view_state, VS_PUBLIC ) ?> /> <?php echo lang_get( 'public' ) ?>
-		<input tabindex="10" type="radio" name="view_state" value="<?php echo VS_PRIVATE ?>" <?php check_checked( $f_view_state, VS_PRIVATE ) ?> /> <?php echo lang_get( 'private' ) ?>
+		<input tabindex="<?php echo $custom_fields_count+9 ?>" type="radio" name="view_state" value="<?php echo VS_PUBLIC ?>" <?php check_checked( $f_view_state, VS_PUBLIC ) ?> /> <?php echo lang_get( 'public' ) ?>
+		<input tabindex="<?php echo $custom_fields_count+10 ?>" type="radio" name="view_state" value="<?php echo VS_PRIVATE ?>" <?php check_checked( $f_view_state, VS_PRIVATE ) ?> /> <?php echo lang_get( 'private' ) ?>
 	</td>
 </tr>
 
@@ -234,7 +236,7 @@
 		<?php echo lang_get( 'report_stay' ) ?> <?php print_documentation_link( 'report_stay' ) ?>
 	</td>
 	<td>
-		<input tabindex="11" type="checkbox" name="report_stay" <?php check_checked( $f_report_stay ) ?> /> (<?php echo lang_get( 'check_report_more_bugs' ) ?>)
+		<input tabindex="<?php echo $custom_fields_count+11 ?>" type="checkbox" name="report_stay" <?php check_checked( $f_report_stay ) ?> /> (<?php echo lang_get( 'check_report_more_bugs' ) ?>)
 	</td>
 </tr>
 
@@ -245,7 +247,7 @@
 		<span class="required"> * <?php echo lang_get( 'required' ) ?></span>
 	</td>
 	<td class="center">
-		<input tabindex="12" type="submit" value="<?php echo lang_get( 'submit_report_button' ) ?>" />
+		<input tabindex="<?php echo $custom_fields_count+12 ?>" type="submit" value="<?php echo lang_get( 'submit_report_button' ) ?>" />
 	</td>
 </tr>
 
Index: core/custom_field_api.php
===================================================================
RCS file: /cvsroot/mantisbt/mantisbt/core/custom_field_api.php,v
retrieving revision 1.24
diff -u -r1.24 custom_field_api.php
--- core/custom_field_api.php	24 Feb 2004 23:51:38 -0000	1.24
+++ core/custom_field_api.php	28 Feb 2004 22:02:46 -0000
@@ -817,8 +817,10 @@
 	# $p_bug_id    contains the bug where this field belongs to. If it's left
 	#              away, it'll default to 0 and thus belongs to a new (i.e.
 	#              non-existant) bug
+	# $p_tabindex  tabindex value to set to the input control. If empty, it is
+	#			   ommitted in the html code.
 	# NOTE: This probably belongs in the print_api.php
-	function print_custom_field_input( $p_field_def, $p_bug_id = null ) {
+	function print_custom_field_input( $p_field_def, $p_bug_id = null, $p_tabindex = null ) {
 		$t_id = $p_field_def['id'];
 
 		if( null == $p_bug_id ) {
@@ -826,12 +828,18 @@
 		} else {
 			$t_custom_field_value = custom_field_get_value( $t_id, $p_bug_id );
 		}
+		
+		if ( null == $p_tabindex ) {
+			$t_tabindex = '';
+		} else {
+			$t_tabindex = " tabindex=\"$p_tabindex\" ";
+		}
 
 		$t_custom_field_value = string_attribute( $t_custom_field_value );
 
 		switch ($p_field_def['type']) {
 		case CUSTOM_FIELD_TYPE_ENUM:
-			echo "<select name=\"custom_field_$t_id\">";
+			echo "<select $t_tabindex name=\"custom_field_$t_id\">";
 			$t_values = explode('|', $p_field_def['possible_values']);
 			foreach( $t_values as $t_option ) {
 				if( $t_custom_field_value == $t_option ) {
@@ -847,7 +855,7 @@
 		case CUSTOM_FIELD_TYPE_EMAIL:
 		default:
 		case CUSTOM_FIELD_TYPE_STRING:
-			echo "<input type=\"text\" name=\"custom_field_$t_id\" size=\"80\"";
+			echo "<input $t_tabindex type=\"text\" name=\"custom_field_$t_id\" size=\"80\"";
 			if( 0 < $p_field_def['length_max'] ) {
 				echo ' maxlength="' . $p_field_def['length_max'] . '"';
 			} else {
mantis-3460.diff (8,163 bytes)   
pnaaijkens

pnaaijkens

2004-02-28 17:22

reporter   ~0005132

I think the patch solves the problem. The 'tabindex' attribute is added to the custom fields.

grangeway

grangeway

2004-06-29 17:09

reporter   ~0005822

Any objections or reasons why this shouldn't be applied?. If not, i'll look at updating this patch and getting it applied to CVS version

vboctor

vboctor

2004-06-30 06:42

manager   ~0005830

I had a quick look at the patch. I don't object on the concept, but I think the implementation has a problem in terms of maintainability:

  • echo $custom_fields_count+8

I would rather avoid absolute number since they will cause problems when an extra field is added. I suggest having a running counter "tabindex" which gets incremented and used all the time.

echo ++$tabindex;

There maybe a reason why this is not done, if that's the case lets see if we can find other way to avoid maintenance problems in the future.

pnaaijkens

pnaaijkens

2004-06-30 06:51

reporter   ~0005831

I can't remember why exactly I've written it this way. Probably because a more general approach like vboctor proposed, demands a lot of rewriting of the forms. But it is indeed not very maintanable right now...

JeromyK

JeromyK

2014-02-12 04:26

reporter  

Tabindex.png (17,120 bytes)   
Tabindex.png (17,120 bytes)   
JeromyK

JeromyK

2014-02-12 04:32

reporter   ~0039382

Hello everybody

I think the "Tabbing-Problem" is still there in 1.12.15.

Here are the steps to reproduce:

1) Add a custom field (I use "Transportauftrag")
2) Go to ./bug_report_page.php -> Tabbing works fine
3) Add a new bug
4) Enter the bug an set it to status "done"
5) You will receive the ./bug_change_status_page.php
6) The custom-field is not in tab-order, it will be "overjumped"

dregad

dregad

2016-08-18 03:10

developer   ~0053846

Duplicate 0010800 had a proposed pull request https://github.com/mantisbt/mantisbt/pull/145 that was not finalized as the original submitter never responded to review comments.

Issue History

Date Modified Username Field Change
2003-12-15 10:50 vboctor New Issue
2003-12-18 22:23 vboctor Note Added: 0004833
2004-02-25 10:07 cbh Note Added: 0005112
2004-02-28 17:22 pnaaijkens File Added: mantis-3460.diff
2004-02-28 17:22 pnaaijkens Note Added: 0005132
2004-06-29 17:09 grangeway Note Added: 0005822
2004-06-29 17:09 grangeway Status new => assigned
2004-06-29 17:09 grangeway Assigned To => grangeway
2004-06-30 06:42 vboctor Note Added: 0005830
2004-06-30 06:51 pnaaijkens Note Added: 0005831
2008-07-13 11:18 grangeway Tag Attached: patch
2014-02-12 04:26 JeromyK File Added: Tabindex.png
2014-02-12 04:32 JeromyK Note Added: 0039382
2014-09-22 18:47 grangeway Category bugtracker => custom fields
2014-11-07 15:06 atrol Assigned To grangeway =>
2014-11-07 15:06 atrol Status assigned => new
2016-08-18 03:06 dregad Relationship added has duplicate 0006167
2016-08-18 03:10 dregad Relationship added has duplicate 0010800
2016-08-18 03:10 dregad Note Added: 0053846