View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
19212Bug reportsExpression Managerpublic2023-10-31 17:27
ReporterUnwritten Assigned To 
PrioritynoneSeverityminor 
Status newResolutionopen 
Product Version6.3.x 
Summary19212: Fields validated by Regex appear red even though regex is correct
Description

When adding regex input validation, the field in question turns red when an invalid input is entered. This usually goes away when the input is corrected, but sometimes, it stays red.

I attached the .lss file with the issue at hand, so it should be very easy to reproduce. The two screenshots show what happens: When a truly invalid answer is given, an error message is produced. When the input is correct (but marked red), the input is still accepted. This confuses the user, because he thinks that his input is invalid, even though the input is accepted by the survey.

Steps To Reproduce

Steps to reproduce

  1. Create survey question with a regex, for example /^(+|00)[0-9]+$/.
  2. preview or run survey
  3. enter a valid input. in this example, I enter +23432342.

Expected result

Field does not turn red and is accepted (no error message is produced).

Actual result

Field turns red, even though the value is accepted and no error message is produced.

TagsNo tags attached.
Attached Files
limesurvey_survey_493929.lss (20,013 bytes)   
regex_bug1.png (40,575 bytes)   
regex_bug.png (55,020 bytes)   
Bug heat6
Complete LimeSurvey version number (& build) Version 6.3.0+231016
I will donate to the project if issue is resolvedNo
BrowserWaterfox G6.0.5 (64-bit)
Database type & versionI don't know but I don't think it's important
Server OS (if known)
Webserver software & version (if known)
PHP VersionI unfortunately can't figure this out within reasonable time, either.

Relationships

related to 13881 new EM : Not number question replace . by , (javascript) 

Users monitoring this issue

DenisChenu

Activities

Unwritten

Unwritten

2023-10-30 21:06

reporter   ~78157

I escape the + in the regex, but I think this bug tracking tool removed the backslash...

regex.png (6,956 bytes)   
DenisChenu

DenisChenu

2023-10-31 17:26

developer   ~78187

I think it's because LimeSurvey expression script try to set a number event if you don't want a number …
Then here : remove the + when testing

https://bugs.limesurvey.org/view.php?id=13881

Issue History

Date Modified Username Field Change
2023-10-30 21:03 Unwritten New Issue
2023-10-30 21:03 Unwritten File Added: limesurvey_survey_493929.lss
2023-10-30 21:03 Unwritten File Added: regex_bug1.png
2023-10-30 21:03 Unwritten File Added: regex_bug.png
2023-10-30 21:06 Unwritten Note Added: 78157
2023-10-30 21:06 Unwritten File Added: regex.png
2023-10-30 21:06 Unwritten Bug heat 0 => 2
2023-10-31 17:26 DenisChenu Note Added: 78187
2023-10-31 17:26 DenisChenu Bug heat 2 => 4
2023-10-31 17:27 DenisChenu Relationship added related to 13881
2023-10-31 17:27 DenisChenu Issue Monitored: DenisChenu
2023-10-31 17:27 DenisChenu Bug heat 4 => 6