View Issue Details

This bug affects 1 person(s).
 4
IDProjectCategoryView StatusLast Update
11966Bug reportsSurvey takingpublic2017-02-03 14:13
Reporterseancarlos Assigned Toc_schmitz  
PrioritynoneSeverityminor 
Status closedResolutionno change required 
Product Version2.55.x 
Summary11966: Warning "Please check the format of your answer" appears even when regex answer validation is correct
Description

During data entry in a regex validated field the warning message "Please check the format of your answer" appears in red while the user types their answer. The message color changes to yellow - and remains - once the user has supplied a valid answer. Expected behavior: the message should disappear. (Using default template.) This is a minor issue with major impact: confused users.

Additional Information

This appears to be a regression: see bug 5823 for previous solution. I added

.em_regex_validation.good {
display: none;
}

to template.css and the problem appears to be fixed.

TagsNo tags attached.
Attached Files
Bug heat4
Complete LimeSurvey version number (& build)2.56.1+161118
I will donate to the project if issue is resolvedNo
BrowserGoogle Chrome 54.0.2840.100 (Official Build) (64-bit)
Database type & version260
Server OS (if known)Linux? (Dreamhost)
Webserver software & version (if known)Apache
PHP Version5.5

Users monitoring this issue

There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2016-11-30 11:11

developer   ~42280

Last edited: 2016-11-30 13:46

Please provide a little .lss file with one question demonstrating the issue.

DenisChenu

DenisChenu

2016-11-30 15:58

developer   ~42297

OK, got it : it's more a sentence issue than a bug.

For example : for numeric : we have "Only numbers may be entered in this field." https://github.com/LimeSurvey/LimeSurvey/blob/master/application/helpers/expressions/em_manager_helper.php#L3133 it's OK in all case (if input contain only num : no issue)

Here : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/helpers/expressions/em_manager_helper.php#L3367

2 solution :

  • find a better sentence "Your answer must respect some restriction"
  • Make a regexp test {if(regex(...),"Format of your answer are OK","Please check the format of your answer")}

PS : better to use https://manual.limesurvey.org/Question_type_-_Short_free_text#Whole_question_validation_equation_.28em_validation_q.29 because you can put the string you want.

seancarlos

seancarlos

2016-11-30 17:36

reporter   ~42302

I suspect I didn't explain the problem very well. In the specific example REGEX evaluates input for a valid email address format. This works perfectly. The problem is the "Please check the format of your answer" message remains on the screen, changing from red to yellow, once the user input passes the regex test. If the input passes the regex test, the warning text shouldn't become yellow, it should disappear. This isn't a text messaging problem (but thank you for the tip in the PS above).

seancarlos

seancarlos

2016-12-01 10:46

reporter   ~42305

I just tried the "Whole question validation equation (em_validation_q)" as suggested in the PS note above. During data entry, the custom message appears in red, next to a red exclamation mark. Once the entry passes the regex test, the message disappears, BUT the exclamation mark remains and becomes yellow, similar to the issue I reported in this bug. The html:

<div id="vmsg_1194_q_fn_validation" class="em_q_fn_validation emtip good">

&lt;span class=&quot;fa fa-exclamation-circle&quot; aria-hidden=&quot;true&quot;>&lt;/span>
&lt;span id=&quot;LEMtailor_Q_1194_8&quot;>&lt;/span>&lt;/div>

Question validation equation:
(isempty(q09) or regexMatch('/^(\w[-.+\w]\w@\w[-._\w]\w.\w{2,3})$/',q09))

Question validation tip (en):
{if((isempty(q09) or regexMatch('/^(\w[-.+\w]\w@\w[-._\w]\w.\w{2,3})$/',q09)),'','Please enter a valid email address.<br />')}

For me this is low priority, I "fixed" it by using a modified template; I'm just documenting this should it be useful to others.

DenisChenu

DenisChenu

2016-12-06 17:22

developer   ~42416

For Question validation tip (en):

{if((isempty(q09) or regexMatch('/^(\w[-.+\w]\w@\w[-._\w]\w.\w{2,3})$/',q09)),'You email adress seems valid','Please enter a valid email address.')}

:)

Issue History

Date Modified Username Field Change
2016-11-30 09:05 seancarlos New Issue
2016-11-30 11:11 DenisChenu Note Added: 42280
2016-11-30 13:46 c_schmitz Assigned To => c_schmitz
2016-11-30 13:46 c_schmitz Status new => feedback
2016-11-30 13:46 c_schmitz Note Edited: 42280
2016-11-30 15:35 seancarlos File Added: limesurvey_survey_888.lss
2016-11-30 15:35 seancarlos Status feedback => assigned
2016-11-30 15:58 DenisChenu Note Added: 42297
2016-11-30 17:36 seancarlos Note Added: 42302
2016-12-01 10:46 seancarlos Note Added: 42305
2016-12-06 17:22 DenisChenu Note Added: 42416
2017-02-03 14:13 c_schmitz Status assigned => closed
2017-02-03 14:13 c_schmitz Resolution open => no change required