View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
03586Bug reportsSurvey takingpublic2009-08-31 15:12
Reporteruser4606Assigned Toc_schmitz  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version1.85+ 
Fixed in Version1.85+ 
Summary03586: Patch for improved accessibility (alt tags on text input boxes)
Description

Modified qanda.php to add alt labels to text box elements for improved Section 508 compliance.

TagsNo tags attached.
Attached Files
section508.diff (8,261 bytes)   
*** qanda.php	2009-08-18 14:07:39.000000000 -0500
--- qanda.php.orig	2009-08-18 12:38:54.000000000 -0500
***************
*** 1085,1091 ****
                      }        
          }
  
! 		$answer .= '<input class="text" type="text" size="10" name="'.$ia[1].'" style="display: none" id="answer'.$ia[1].'" value="'.$_SESSION[$ia[1]].'" maxlength="10" alt="answer" onchange="checkconditions(this.value, this.name, this.type)" />
  			</p>';
  		$answer .= '<input type="hidden" name="qattribute_answer[]" value="'.$ia[1].'" />
  			        <input type="hidden" id="qattribute_answer'.$ia[1].'" name="qattribute_answer'.$ia[1].'" />
--- 1085,1091 ----
                      }        
          }
  
! 		$answer .= '<input class="text" type="text" size="10" name="'.$ia[1].'" style="display: none" id="answer'.$ia[1].'" value="'.$_SESSION[$ia[1]].'" maxlength="10" onchange="checkconditions(this.value, this.name, this.type)" />
  			</p>';
  		$answer .= '<input type="hidden" name="qattribute_answer[]" value="'.$ia[1].'" />
  			        <input type="hidden" id="qattribute_answer'.$ia[1].'" name="qattribute_answer'.$ia[1].'" />
***************
*** 1110,1116 ****
              }
              
              $answer ="<p class=\"question\">
! 				        <input class='popupdate' type=\"text\" size=\"10\" name=\"{$ia[1]}\" id=\"answer{$ia[1]}\" value=\"$dateoutput\" maxlength=\"10\" alt=\"Date Picker\" onkeypress=\"return goodchars(event,'0123456789-')\" onchange=\"checkconditions(this.value, this.name, this.type)\" />
                          <input  type='hidden' name='dateformat{$ia[1]}' id='dateformat{$ia[1]}' value='{$dateformatdetails['jsdate']}'  />
                          <input  type='hidden' name='datelanguage{$ia[1]}' id='datelanguage{$ia[1]}' value='{$clang->langcode}'  />
  			         </p>
--- 1110,1116 ----
              }
              
              $answer ="<p class=\"question\">
! 				        <input class='popupdate' type=\"text\" size=\"10\" name=\"{$ia[1]}\" id=\"answer{$ia[1]}\" value=\"$dateoutput\" maxlength=\"10\" onkeypress=\"return goodchars(event,'0123456789-')\" onchange=\"checkconditions(this.value, this.name, this.type)\" />
                          <input  type='hidden' name='dateformat{$ia[1]}' id='dateformat{$ia[1]}' value='{$dateformatdetails['jsdate']}'  />
                          <input  type='hidden' name='datelanguage{$ia[1]}' id='datelanguage{$ia[1]}' value='{$clang->langcode}'  />
  			         </p>
***************
*** 1379,1385 ****
  //		// --> END BUG FIX
  
  		// --> START NEW FEATURE - SAVE
! 		$answer .= " alt=\"other answer\" onchange='checkconditions(this.value, this.name, this.type);'";
  		$thisfieldname="$ia[1]other";
  		if (isset($_SESSION[$thisfieldname])) { $answer .= " value='".htmlspecialchars($_SESSION[$thisfieldname],ENT_QUOTES)."' ";}
  		$answer .= ' />';
--- 1379,1385 ----
  //		// --> END BUG FIX
  
  		// --> START NEW FEATURE - SAVE
! 		$answer .= " onchange='checkconditions(this.value, this.name, this.type);'";
  		$thisfieldname="$ia[1]other";
  		if (isset($_SESSION[$thisfieldname])) { $answer .= " value='".htmlspecialchars($_SESSION[$thisfieldname],ENT_QUOTES)."' ";}
  		$answer .= ' />';
***************
*** 1523,1529 ****
  ';
  	}
  
! 	$answer .= '				<input type="hidden" name="java'.$ia[1].'" id="java'.$ia[1]."\" value=\"{$_SESSION[$ia[1]]}\" alt=\"other text\" />\n";
  
  	if (isset($other) && $other=="Y")
  	{
--- 1523,1529 ----
  ';
  	}
  
! 	$answer .= '				<input type="hidden" name="java'.$ia[1].'" id="java'.$ia[1]."\" value=\"{$_SESSION[$ia[1]]}\" />\n";
  
  	if (isset($other) && $other=="Y")
  	{
***************
*** 1558,1564 ****
  		."\t}\n"
  		."//--></script>\n".$answer;
  
! 		$answer .= '				<input type="text" id="othertext'.$ia[1].'" name="'.$ia[1].'other" alt="other text" style="display:';
  		if ($_SESSION[$ia[1]] != '-oth-')
  		{
  			$answer .= ' none';
--- 1558,1564 ----
  		."\t}\n"
  		."//--></script>\n".$answer;
  
! 		$answer .= '				<input type="text" id="othertext'.$ia[1].'" name="'.$ia[1].'other" style="display:';
  		if ($_SESSION[$ia[1]] != '-oth-')
  		{
  			$answer .= ' none';
***************
*** 2698,2704 ****
  		}
  
  		$answer .= $wrapper['item-start'].'
! 		<input class="checkbox" type="checkbox" name="'.$myfname.'cbox" id="answer'.$myfname.'cbox" alt="Other"';
  
  		if (isset($_SESSION[$myfname]) && trim($_SESSION[$myfname])!='')
  		{
--- 2698,2704 ----
  		}
  
  		$answer .= $wrapper['item-start'].'
! 		<input class="checkbox" type="checkbox" name="'.$myfname.'cbox" id="answer'.$myfname.'cbox"';
  
  		if (isset($_SESSION[$myfname]) && trim($_SESSION[$myfname])!='')
  		{
***************
*** 3705,3711 ****
  	}
  	// --> START NEW FEATURE - SAVE
  	$answer = "<p class=\"question\">\n\t$prefix\n\t<input class=\"text\" type=\"text\" size=\"$tiwidth\" name=\"$ia[1]\" "
! 	. "id=\"answer{$ia[1]}\" value=\"{$_SESSION[$ia[1]]}\" alt=\"answer\" onkeypress=\"return goodchars(event,'0123456789.')\" onchange='checkconditions(this.value, this.name, this.type)'"
  	. "maxlength=\"$maxsize\" />\n\t$suffix\n</p>\n"
  	. "<p class=\"tip\">".$clang->gT('Only numbers may be entered in this field')."</p>\n";
  	// --> END NEW FEATURE - SAVE
--- 3705,3711 ----
  	}
  	// --> START NEW FEATURE - SAVE
  	$answer = "<p class=\"question\">\n\t$prefix\n\t<input class=\"text\" type=\"text\" size=\"$tiwidth\" name=\"$ia[1]\" "
! 	. "id=\"answer{$ia[1]}\" value=\"{$_SESSION[$ia[1]]}\" onkeypress=\"return goodchars(event,'0123456789.')\" onchange='checkconditions(this.value, this.name, this.type)'"
  	. "maxlength=\"$maxsize\" />\n\t$suffix\n</p>\n"
  	. "<p class=\"tip\">".$clang->gT('Only numbers may be entered in this field')."</p>\n";
  	// --> END NEW FEATURE - SAVE
***************
*** 3757,3763 ****
  	// --> START NEW FEATURE - SAVE
  	$answer = "<p class=\"question\">\n\t$prefix\n\t<input class=\"text\" type=\"text\" size=\"$tiwidth\" name=\"$ia[1]\" id=\"answer$ia[1]\" value=\""
  	.str_replace ("\"", "'", str_replace("\\", "", $_SESSION[$ia[1]]))
! 	."\" maxlength=\"$maxsize\" alt=\"answer\" onkeyup=\"checkconditions(this.value, this.name, this.type)\" />\n\t$suffix\n</p>\n";
  	// --> END NEW FEATURE - SAVE
  
  	$inputnames[]=$ia[1];
--- 3757,3763 ----
  	// --> START NEW FEATURE - SAVE
  	$answer = "<p class=\"question\">\n\t$prefix\n\t<input class=\"text\" type=\"text\" size=\"$tiwidth\" name=\"$ia[1]\" id=\"answer$ia[1]\" value=\""
  	.str_replace ("\"", "'", str_replace("\\", "", $_SESSION[$ia[1]]))
! 	."\" maxlength=\"$maxsize\" onkeyup=\"checkconditions(this.value, this.name, this.type)\" />\n\t$suffix\n</p>\n";
  	// --> END NEW FEATURE - SAVE
  
  	$inputnames[]=$ia[1];
***************
*** 3816,3822 ****
  	// --> START ENHANCEMENT - TEXT INPUT WIDTH
  
  	// --> START NEW FEATURE - SAVE
! 	$answer .= '<textarea class="textarea" name="'.$ia[1].'" id="answer'.$ia[1].'" alt="answer" '
  	.'rows="'.$drows.'" cols="'.$tiwidth.'" onkeyup="textLimit(\'answer'.$ia[1].'\', '.$maxsize.'); checkconditions(this.value, this.name, this.type)">';
  	// --> END NEW FEATURE - SAVE
  
--- 3816,3822 ----
  	// --> START ENHANCEMENT - TEXT INPUT WIDTH
  
  	// --> START NEW FEATURE - SAVE
! 	$answer .= '<textarea class="textarea" name="'.$ia[1].'" id="answer'.$ia[1].'" '
  	.'rows="'.$drows.'" cols="'.$tiwidth.'" onkeyup="textLimit(\'answer'.$ia[1].'\', '.$maxsize.'); checkconditions(this.value, this.name, this.type)">';
  	// --> END NEW FEATURE - SAVE
  
***************
*** 3881,3887 ****
  	// --> START ENHANCEMENT - TEXT INPUT WIDTH
  
  	// --> START NEW FEATURE - SAVE
! 	$answer .= '<textarea class="display" name="'.$ia[1].'" id="answer'.$ia[1].'" alt="answer" '
  	.'rows="'.$drows.'" cols="'.$tiwidth.'" onkeyup="textLimit(\'answer'.$ia[1].'\', '.$maxsize.'); checkconditions(this.value, this.name, this.type)">';
  	// --> END NEW FEATURE - SAVE
  
--- 3881,3887 ----
  	// --> START ENHANCEMENT - TEXT INPUT WIDTH
  
  	// --> START NEW FEATURE - SAVE
! 	$answer .= '<textarea class="display" name="'.$ia[1].'" id="answer'.$ia[1].'" '
  	.'rows="'.$drows.'" cols="'.$tiwidth.'" onkeyup="textLimit(\'answer'.$ia[1].'\', '.$maxsize.'); checkconditions(this.value, this.name, this.type)">';
  	// --> END NEW FEATURE - SAVE
  
section508.diff (8,261 bytes)   
Bug heat4
Complete LimeSurvey version number (& build)7191
I will donate to the project if issue is resolved
Browser
Database type & version
Server OS (if known)
Webserver software & version (if known)
PHP Version

Users monitoring this issue

There are no users monitoring this issue.

Activities

user372

2009-08-18 22:06

  ~09161

@ c_schmitz: please verify the attached patch

c_schmitz

c_schmitz

2009-08-19 15:02

administrator   ~09178

Last edited: 2009-08-19 15:02

johnichiban, can you attached the modified file please? I am having problems with the patch.

c_schmitz

c_schmitz

2009-08-24 00:40

administrator   ~09197

Pretty please?

Issue History

Date Modified Username Field Change
2009-08-18 22:03 user4606 New Issue
2009-08-18 22:03 user4606 Status new => assigned
2009-08-18 22:03 user4606 Assigned To => user372
2009-08-18 22:03 user4606 File Added: section508.diff
2009-08-18 22:03 user4606 Build Number => 7191
2009-08-18 22:05 user372 Assigned To user372 => c_schmitz
2009-08-18 22:06 user372 Note Added: 09161
2009-08-19 15:02 c_schmitz Note Added: 09178
2009-08-19 15:02 c_schmitz Note Edited: 09178
2009-08-19 15:03 c_schmitz Status assigned => feedback
2009-08-24 00:40 c_schmitz Note Added: 09197
2009-08-27 12:28 c_schmitz Status feedback => resolved
2009-08-27 12:28 c_schmitz Fixed in Version => 1.85+
2009-08-27 12:28 c_schmitz Resolution open => fixed
2009-08-31 15:12 c_schmitz Status resolved => closed
2010-10-25 00:18 c_schmitz Category Survey at Runtime => Survey taking