View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
05849Bug reportsOtherpublic2012-07-05 22:16
ReporterTMSWhite Assigned ToTMSWhite  
PrioritylowSeverityminor 
Status closedResolutionfixed 
Product Version1.92RC4 
Fixed in Version1.92+ 
Summary05849: Unable to paste into numeric question types
Description

Can't paste into any numeric question type (or ones that use numbers_only or other_numbers_only advanced question options)

Steps To Reproduce

Tested in Git revision a59c50916d58af02be9584fa87905b42ba1ab0a8

Test with attached survey

Additional Information

This is also a problem with 1.91+ as of last SVN revision

TagsNo tags attached.
Attached Files
Bug heat6
Complete LimeSurvey version number (& build)12455
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMysql 5.3
Server OS (if known)Windows XP
Webserver software & version (if known)XAMPP
PHP Version5.3

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2012-02-25 16:57

developer   ~17631

Hello,

Think of use numberlonly class to have a global js in survey_runtime.js.

With maxlength i do this, and i can copy/paste.

But numberlonly class are only for Yii ....

c_schmitz

c_schmitz

2012-03-02 15:36

administrator   ~17709

I would suggest something like this: http://stackoverflow.com/a/3257682/974390

DenisChenu

DenisChenu

2012-03-02 15:44

developer   ~17712

The "difficulty" is not for [0-9] an -, it's for . and , : langage specific.

Maybe add a inline global var on the survey is the best solution.

Denis

TMSWhite

TMSWhite

2012-03-02 16:04

reporter   ~17713

Actually, I've already fixed the comma issue. And as part of that fix, it validates that the entry is a real number - so if you try to enter "1.2.3", or "-1,23,4-5", the field will be blanked onchange.

Since that processing works, it may be fine to just remove the onkeyup function that only lets you enter numbers. If people enter non-numeric values, the field will be blanked and they will have to try again.

Personally, I think that blanking a field may be safer than removing non-numeric values, since people may not notice that the field is shortened by a character (thus realizing they made a typo), but they'll certainly notice if the field gets blanked.

c_schmitz

c_schmitz

2012-03-02 16:10

administrator   ~17716

I don't think that's ideal.

Let's say you have a non-mandatory field in question by question mode.

User enters 1,234 instead of the valid 1.234 and submits the page.
He will not notice at all that the field was blanked at submit.

I think validation while typing is the better choice.

TMSWhite

TMSWhite

2012-03-02 16:17

reporter   ~17717

It's not blanked at submit - it is blanked onchange - so as soon as they tab off the field. The risk (as you say) is that if they press Next to submit without noticing the onchange event.

Perhaps another option would be to force a re-focus on the field if it gets blanked by this process - that would prevent a submit until they entered a real number (or just left the field blank, which is OK if non mandatory)

c_schmitz

c_schmitz

2012-03-02 16:25

administrator   ~17718

Last edited: 2012-03-02 16:26

I like the later option better.
So why not validate it as any other field?
I would not blank it,
but rather put out a validation error ('PLease enter a valid number or leave it blank')and stop the page from submitting.
I think that is better than loosing the data (=blanking)

TMSWhite

TMSWhite

2012-03-02 16:32

reporter   ~17719

We could certainly add a numbers_only validation option similar to the ones EM now manages and have the field show in pink. I had avoided that since there was also the onkeyup command; but we can move in this direction for a + release (unless you feel this needs to be addressed for 1.92 stable)

c_schmitz

c_schmitz

2012-03-06 00:38

administrator   ~17737

That sounds good.

TMSWhite

TMSWhite

2012-06-28 07:47

reporter   ~19588

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=8873

TMSWhite

TMSWhite

2012-06-29 08:07

reporter   ~19590

Fix committed to Yii branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=8875

c_schmitz

c_schmitz

2012-07-05 22:16

administrator   ~19624

New 1.92+ version released.

Related Changesets

LimeSurvey: master e8d85779

2012-06-27 22:46:29

TMSWhite

Details Diff
Fixed issue 05849: Unable to paste into numeric question types
Dev now can paste into any numeric type. Problem was goodchars() and onkeypress. Instead, remove bad characters during onkeyup (within fixnum_checkconditions()). Bad characters will display briefly then disappear.
Affected Issues
05849
mod - admin/preview.php Diff File
mod - group.php Diff File
mod - qanda.php Diff File
mod - scripts/survey_runtime.js Diff File

LimeSurvey: Yii 558ccf4c

2012-06-28 23:06:32

TMSWhite

Details Diff
Fixed issue 05849: Unable to paste into numeric question types
Dev now can paste into any numeric type. Problem was goodchars() and onkeypress. Instead, remove bad characters during onkeyup (within fixnum_checkconditions()). Bad characters will display briefly then disappear.
Affected Issues
05849
mod - application/controllers/admin/question.php Diff File
mod - application/helpers/SurveyRuntimeHelper.php Diff File
mod - application/helpers/qanda_helper.php Diff File
mod - scripts/survey_runtime.js Diff File

Issue History

Date Modified Username Field Change
2012-02-24 05:39 TMSWhite New Issue
2012-02-24 05:39 TMSWhite File Added: ls2_comma_as_radix_separator.lss
2012-02-25 16:57 DenisChenu Note Added: 17631
2012-03-02 15:36 c_schmitz Note Added: 17709
2012-03-02 15:44 DenisChenu Note Added: 17712
2012-03-02 16:04 TMSWhite Note Added: 17713
2012-03-02 16:10 c_schmitz Note Added: 17716
2012-03-02 16:17 TMSWhite Note Added: 17717
2012-03-02 16:25 c_schmitz Note Added: 17718
2012-03-02 16:26 c_schmitz Note Edited: 17718
2012-03-02 16:32 TMSWhite Note Added: 17719
2012-03-06 00:38 c_schmitz Assigned To => TMSWhite
2012-03-06 00:38 c_schmitz Status new => assigned
2012-03-06 00:38 c_schmitz Note Added: 17737
2012-04-11 17:54 TMSWhite Project Bug reports => Development
2012-06-28 07:47 TMSWhite Changeset attached => LimeSurvey master e8d85779
2012-06-28 07:47 TMSWhite Note Added: 19588
2012-06-28 07:47 TMSWhite Resolution open => fixed
2012-06-28 07:49 TMSWhite Project Development => Bug reports
2012-06-28 07:49 TMSWhite Category Survey taking => Other issues
2012-06-28 07:50 TMSWhite Status assigned => resolved
2012-06-28 07:50 TMSWhite Fixed in Version => 1.92+
2012-06-29 08:07 TMSWhite Changeset attached => LimeSurvey Yii 558ccf4c
2012-06-29 08:07 TMSWhite Note Added: 19590
2012-07-05 22:16 c_schmitz Note Added: 19624
2012-07-05 22:16 c_schmitz Status resolved => closed