Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

[v2] - integer validation with no decimals

  • mfiora
  • mfiora's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
4 years 8 months ago #186165 by mfiora
Hello,
i have a problem with an Array numbers question in the latest release of version 2.

Basically i need the answer to be an integer with no points and no commas.
If i set as a subquestion validation
Code:
is_int(self)
it allows me to type: 600.000 in the answer and it becomes 600,000.
So i tried with a
Code:
regexMatch('/^[0-9]{1,15}$/',self)
and i still get same behaviour.

How can i solve?

Thanks,

Regards,
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 8 months ago #186169 by DenisChenu
Replied by DenisChenu on topic [v2] - integer validation with no decimals
in subquestion validation : it must me is_int(this) in my opinion.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • mfiora
  • mfiora's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
4 years 8 months ago #186173 by mfiora
Replied by mfiora on topic [v2] - integer validation with no decimals
Hello DenisChenu,
i tried that and still if i input 100.000 it changes to 100,000.
Is there a way to block or delete "," and "."?
Thanks,
Regards,
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 8 months ago #186181 by DenisChenu
Replied by DenisChenu on topic [v2] - integer validation with no decimals
What do you want exactly ?

You can disable the auto correction of number input in Theme option : maybe it's what you need ?

PS : i think 100.000 changes to 100,000 is a bug and can be reported : www.limesurvey.org/community/bug-tracker (integer or not)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • mfiora
  • mfiora's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
4 years 8 months ago #186187 by mfiora
Replied by mfiora on topic [v2] - integer validation with no decimals
Hello Denis,
thanks for your reply. Probably disabling the autocorrection of the number input could help me but i don't seem to find "Theme Option".
Could you please help me find it?
Thanks,
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 8 months ago #186190 by DenisChenu
Replied by DenisChenu on topic [v2] - integer validation with no decimals


Maybe you need to reset menu OR : tell us your LimeSurvey version …

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • mfiora
  • mfiora's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
4 years 8 months ago #186193 by mfiora
Replied by mfiora on topic [v2] - integer validation with no decimals
Hello,
use Version 2.73.1. i don't think i have that screen.
Thanks,
Regards,
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 8 months ago #186198 by DenisChenu
Replied by DenisChenu on topic [v2] - integer validation with no decimals
2.73.1 : no theme …

You can try adding
Code:
<script>
LSvar.bFixNumAuto=0;
bFixNumAuto=0;
</script>
In group description

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.
  • mfiora
  • mfiora's Avatar Topic Author
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
4 years 8 months ago #186199 by mfiora
Replied by mfiora on topic [v2] - integer validation with no decimals
Hello DenisChenu,
thanks for your reply. With your hint it does not autocorrect the value. But i would like the question to give a warning when a "." or a "," is inserted. At the moment both are allowed and give no warning even if i use regexMatch.
Thanks,

Regards,
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 8 months ago #186204 by DenisChenu
Replied by DenisChenu on topic [v2] - integer validation with no decimals
Seems bNumRealValue is broken in 2.73 version …

Workaround : use array of text (i use it in 3.X when need numeric with sepearator …).

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand , plugin development .
I don't answer to private message.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose