View Issue Details

IDProjectCategoryView StatusLast Update
04794User patches[All Projects] Survey designpublic2010-12-14 13:02
Reporteruser9586Assigned Toc_schmitz  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version1.90+ 
Target VersionFixed in Version1.91 
Summary04794: Support maximum_chars in array/numbers (text input layout)
Description

This patch adds support for the "maximum_chars" attribute to the array/numbers question type, when using the text input layout.

TagsNo tags attached.
Complete LimeSurvey version number (& build)9586

Relationships

parent of 04795 closeduser9586 Support JS keypad input in array/numbers (text inputs layout). 

Activities

user9586

2010-12-06 15:59

 

svn-patch.diff (1,703 bytes)
Index: common_functions.php
===================================================================
--- common_functions.php	(revision 9586)
+++ common_functions.php	(working copy)
@@ -3754,7 +3754,7 @@
     "caption"=>$clang->gT('Max value from SGQA'));
 
     $qattributes["maximum_chars"]=array(
-    "types"=>"STUNQK",
+    "types"=>"STUNQK:",
     'category'=>$clang->gT('Input'),
     'sortorder'=>100,
     'inputtype'=>'text',
Index: qanda.php
===================================================================
--- qanda.php	(revision 9586)
+++ qanda.php	(working copy)
@@ -6522,6 +6522,15 @@
         $inputboxlayout=true;
     }
 
+    if (trim($qidattributes['maximum_chars'])!='')
+    {
+        $maxsize=$qidattributes['maximum_chars'];
+    }
+    else
+    {
+        $maxsize=255;
+    }
+
     if (trim($qidattributes['answer_width'])!='')
     {
         $answerwidth=$qidattributes['answer_width'];
@@ -6686,7 +6695,7 @@
                     {
                         $sSeperator = getRadixPointData($thissurvey['surveyls_numberformat']);
                         $sSeperator = $sSeperator['seperator'];
-                        $answer .= "\t<input type='text' class=\"multiflexitext\" name=\"$myfname2\" id=\"answer{$myfname2}\" size=5 title=\""
+                        $answer .= "\t<input type='text' class=\"multiflexitext\" name=\"$myfname2\" id=\"answer{$myfname2}\" maxlength=\"{$maxsize}\" size=5 title=\""
                         . html_escape($labelans[$thiskey]).'"'
                         . " onchange=\"$checkconditionFunction(this.value, this.name, this.type)\" onkeypress=\"return goodchars(event,'0123456789$sSeperator')\""
                         . " value=\"";
svn-patch.diff (1,703 bytes)
c_schmitz

c_schmitz

2010-12-07 14:09

administrator   ~13706

Thank you! Applied.

Issue History

Date Modified Username Field Change
2010-12-06 15:59 user9586 New Issue
2010-12-06 15:59 user9586 File Added: svn-patch.diff
2010-12-07 14:09 c_schmitz Project Bug reports => User patches
2010-12-07 14:09 c_schmitz Note Added: 13706
2010-12-07 14:09 c_schmitz Status new => resolved
2010-12-07 14:09 c_schmitz Fixed in Version => 1.91
2010-12-07 14:09 c_schmitz Resolution open => fixed
2010-12-07 14:09 c_schmitz Assigned To => c_schmitz
2010-12-07 14:13 c_schmitz Relationship added parent of 04795
2010-12-14 13:02 c_schmitz Status resolved => closed