View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
09369Bug reportsSurvey takingpublic2014-12-10 09:21
ReporterMcRoa Assigned ToDenisChenu  
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version2.05+ 
Fixed in Version2.05+ 
Summary09369: Mandatory type N fields are validated upon first display
Description

Mondatory fields of type N (numeric) are prematurely validated upon their first display - no 'previous' or 'next' form submit - resulting in an error message stating the field should only contain numbers. Browsing a grouped survey has the same result. See attached test survey.

Steps To Reproduce

Add a type N field to any survey and make it mandatory. No default value or any other special settings.

TagsNo tags attached.
Attached Files
Bug heat6
Complete LimeSurvey version number (& build)141113
I will donate to the project if issue is resolvedYes
BrowserAny
Database type & versionMySQL 5.5.40
Server OS (if known)Linux (CentOS)
Webserver software & version (if known)Apache 2.4.10
PHP VersionPHP 5.4.33

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2014-11-21 18:00

developer   ~31022

Last edited: 2014-11-21 18:01

No input-error added in question class.
Validated only in JS, like when you set Minimum value to 1 for example.

The error is not "mandatory numeric question is validated', the error is 'mandatory text question is not validated'.

I think it's a no fix needed.

McRoa

McRoa

2014-11-21 18:09

reporter   ~31024

Last edited: 2014-11-21 18:10

Hi Denis,

Thanks for your reply. If you run the test survey don't you think it's strange that the numeric fields generate an error message and the text fields do not? Both are empty upon first display, both are mandatory and yet only the numeric fields complain about being empty.

IMHO someone taking a survey should at least have one chance to fill any field before validation messages should appear ...

Regards!

DenisChenu

DenisChenu

2014-11-21 18:22

developer   ~31025

Last edited: 2014-11-21 18:23

There are some template issue here.

With citronade, and set hide tip to no : you don't see the error before click next.

And if you set the second question : not mandatory and minimum value to 2 : you see the same behaviour than mandatory :).

You have the near same behaviour with:

  • Date question type
  • Minimum answers for multi text and multi numeric
  • etc ....

I can fix it easily, but not sure we want to fix it. I think i move mandatory to EM for 2.06, maybe ....

PS: http://limesurvey.sondages.pro/survey/index/sid/275598/newtest/Y/lang/en you "don't" see the error at the first group.

DenisChenu

DenisChenu

2014-11-21 18:27

developer   ~31026

In fact : it's smae than short text with numeric only system.

Thisone show error since a long long time ....

McRoa

McRoa

2014-11-21 22:04

reporter   ~31033

Okay, thanks for your time Denis. I think I dig into the template (a custom variant of 'default') code and styles to see if I can find a workaround.

DenisChenu

DenisChenu

2014-11-22 14:40

developer   ~31038

Hi,

For the template you have:
.hide-tip : did hide tip is active or not
.good : it's OK
.error : it's an error.

.em_other_comment_mandatory : comment other mandatory
.em_regex_validation : regexp validation
.em_regex_validation.error : regexp validation with error
.em_default : it's your class to hide or show the tip.

But still, not sure what to do. Maybe : all tip accept empty + em_mandatory tip more for all :).

Then i think we can validate the page before accept submit.

Denis

McRoa

McRoa

2014-11-22 20:56

reporter   ~31053

Last edited: 2014-11-22 20:57

Hi Denis,

Thanks again for your effort! With some searching in and tweaking of the styles I succeeded in achieving my goal: no more messages or red input backgrounds when a page with mandatory fields is shown for the first time.

I think it would be a great idea to put all validation logic in one place as it's quite complex and diverted now. As far as I've seen LS is not using AJAX-calls at the moment, IMHO this is a neat way to accomplish validation before submitting a form.

Although stricktly spoken the problem is not solved with my workaround, I will make a modest donation to the project, because I value LS and I think open source software in general should be supported ;-)

Regards!
McRoa

DenisChenu

DenisChenu

2014-12-09 15:33

developer   ~31216

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

DenisChenu

DenisChenu

2014-12-09 15:39

developer   ~31217

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

DenisChenu

DenisChenu

2014-12-09 15:40

developer   ~31218

Same behaviour for mandatory question and non mandatory question

DenisChenu

DenisChenu

2014-12-09 15:41

developer   ~31219

@McRoa : actually a lot of validation except mandatory is done in javascript. No need ajax.
You can validate a survey before allow click with js. Maybe some specific issue, but surely can be done.

c_schmitz

c_schmitz

2014-12-10 09:21

administrator   ~31224

Version 2.05+ Build 141210 released

Related Changesets

LimeSurvey: 2.06 759a5e54

2014-12-09 14:33:23

DenisChenu

Details Diff
Fixed issue 09369: Mandatory type N fields are validated upon first submit
Dev : leave mandatory for mandatory in other question too
Affected Issues
09369
mod - application/helpers/expressions/em_manager_helper.php Diff File

LimeSurvey: master 89b1847d

2014-12-09 14:39:22

DenisChenu

Details Diff
Fixed issue 09369: Mandatory type N fields are validated upon first submit
Dev : leave mandatory for mandatory in other question too
Affected Issues
09369
mod - application/helpers/expressions/em_manager_helper.php Diff File

Issue History

Date Modified Username Field Change
2014-11-21 16:46 McRoa New Issue
2014-11-21 16:46 McRoa File Added: limesurvey_survey_275598.lss
2014-11-21 17:14 c_schmitz Assigned To => DenisChenu
2014-11-21 17:14 c_schmitz Status new => assigned
2014-11-21 18:00 DenisChenu Note Added: 31022
2014-11-21 18:01 DenisChenu Note Edited: 31022
2014-11-21 18:09 McRoa Note Added: 31024
2014-11-21 18:10 McRoa Note Edited: 31024
2014-11-21 18:22 DenisChenu Note Added: 31025
2014-11-21 18:23 DenisChenu Note Edited: 31025
2014-11-21 18:27 DenisChenu Note Added: 31026
2014-11-21 22:04 McRoa Note Added: 31033
2014-11-21 22:58 c_schmitz Summary Mondatory type N fields are validated upon first display => Mandatory type N fields are validated upon first display
2014-11-22 14:40 DenisChenu Note Added: 31038
2014-11-22 20:56 McRoa Note Added: 31053
2014-11-22 20:57 McRoa Note Edited: 31053
2014-12-09 15:33 DenisChenu Changeset attached => LimeSurvey 2.06 759a5e54
2014-12-09 15:33 DenisChenu Note Added: 31216
2014-12-09 15:33 DenisChenu Resolution open => fixed
2014-12-09 15:39 DenisChenu Changeset attached => LimeSurvey master 89b1847d
2014-12-09 15:39 DenisChenu Note Added: 31217
2014-12-09 15:40 DenisChenu Note Added: 31218
2014-12-09 15:40 DenisChenu Status assigned => resolved
2014-12-09 15:40 DenisChenu Fixed in Version => 2.05+
2014-12-09 15:41 DenisChenu Note Added: 31219
2014-12-10 09:21 c_schmitz Note Added: 31224
2014-12-10 09:21 c_schmitz Status resolved => closed