View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
04563Bug reportsSurvey takingpublic2010-09-08 17:27
Reporterronvdburg Assigned Toc_schmitz  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version1.90+ 
Summary04563: When using dates, the javascript uses the wrong 'goodchars'. Depending on the dateformat, this should be 0123456789 with /,- or.
Description

The goodchars should not be hardcoded to '0123456789-' but depending on the jsformat.

Steps To Reproduce

See qanda.php and look for 0123456789-

Additional Information

svn diff is attached

TagsNo tags attached.
Attached Files
qanda.php.diff (1,434 bytes)   
Index: qanda.php
===================================================================
--- qanda.php	(revision 9091)
+++ qanda.php	(working copy)
@@ -1695,8 +1695,11 @@
             $maxyear='2020';
         }
 
+        $goodchars = str_replace( array("m","d","y"), "", $dateformatdetails['jsdate']);
+        $goodchars = "0123456789".$goodchars[0];
+
         $answer ="<p class=\"question\">
-				        <input class='popupdate' type=\"text\" alt=\"".$clang->gT('Date picker')."\" size=\"10\" name=\"{$ia[1]}\" id=\"answer{$ia[1]}\" value=\"$dateoutput\" maxlength=\"10\" onkeypress=\"return goodchars(event,'0123456789-')\" onchange=\"$checkconditionFunction(this.value, this.name, this.type)\" />
+                        <input class='popupdate' type=\"text\" alt=\"".$clang->gT('Date picker')."\" size=\"10\" name=\"{$ia[1]}\" id=\"answer{$ia[1]}\" value=\"$dateoutput\" maxlength=\"10\" onkeypress=\"return goodchars(event,'".$goodchars."')\" onchange=\"$checkconditionFunction(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}'  />
                         <input  type='hidden' name='dateyearrange{$ia[1]}' id='dateyearrange{$ia[1]}' value='{$minyear}:{$maxyear}'  />
qanda.php.diff (1,434 bytes)   
Bug heat4
Complete LimeSurvey version number (& build)9046
I will donate to the project if issue is resolved
BrowserIE8
Database type & versionmysql 5.0.77
Server OS (if known)Centos 5.3 / Linux 2.6.18
Webserver software & version (if known)apache 2.2.3
PHP Version5.1.6

Users monitoring this issue

ronvdburg

Activities

c_schmitz

c_schmitz

2010-08-28 01:31

administrator   ~12720

Nice patch - thank you very much. Fixed in rev 9095.

c_schmitz

c_schmitz

2010-09-08 17:27

administrator   ~12791

Fix was released in 1.90+ version.

Issue History

Date Modified Username Field Change
2010-08-25 16:46 ronvdburg New Issue
2010-08-25 16:46 ronvdburg File Added: qanda.php.diff
2010-08-25 17:41 ronvdburg Issue Monitored: ronvdburg
2010-08-28 01:29 c_schmitz Assigned To => c_schmitz
2010-08-28 01:29 c_schmitz Status new => assigned
2010-08-28 01:31 c_schmitz Note Added: 12720
2010-08-28 01:31 c_schmitz Status assigned => resolved
2010-08-28 01:31 c_schmitz Resolution open => fixed
2010-09-08 17:27 c_schmitz Note Added: 12791
2010-09-08 17:27 c_schmitz Status resolved => closed
2010-10-25 00:18 c_schmitz Category Survey at Runtime => Survey taking
2021-08-03 05:18 guest Bug heat 2 => 4