Welcome to the LimeSurvey Community Forum

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

Input format for numbers

  • nbubivucjufeegc
  • nbubivucjufeegc's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
4 years 5 months ago - 4 years 5 months ago #190727 by nbubivucjufeegc
Input format for numbers was created by nbubivucjufeegc
I try to put format for only .XX. Example: Only 100.22 EUR can be placed but 100,22 will execute blur effect. How to manage this? It is actually the USA format, not EU format. But only numbers are allowed and also INTEGER should not be blocked. In other words, it is allowed number, XX after comma and comma not the following character: ,

<script type="text/javascript" charset="utf-8">

$(document).ready(function() {
$('#question{QID} input.text').focus(function() {
if ($(this).val() == 0) {
$(this).val('');
}
}).blur(function() {
if ($(this).val() == '') {
$(this).val(0);
}
});
});
</script>
Last edit: 4 years 5 months ago by nbubivucjufeegc.
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 5 months ago #190729 by tpartner
Replied by tpartner on topic Input format for numbers
You could use Robin Herbots Inputmask plugin with a currency alias - github.com/RobinHerbots/Inputmask

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The following user(s) said Thank You: gabrieljenik
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 5 months ago #190750 by DenisChenu
Replied by DenisChenu on topic Input format for numbers

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 following user(s) said Thank You: tpartner
The topic has been locked.
  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 5 months ago #190753 by tpartner
Replied by tpartner on topic Input format for numbers
I would do it with a custom question theme. :)

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
4 years 5 months ago #190769 by DenisChenu
Replied by DenisChenu on topic Input format for numbers

tpartner wrote: I would do it with a custom question theme. :)

Yes, possible, but here : in my opinion, we don't really need update whole HTML, only js :).

I use jQuery-Mask-Plugin because it's more simple to have a editable string for the mask (in question attribute).

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.
More
3 years 11 months ago - 3 years 11 months ago #198804 by mdwhitby
Replied by mdwhitby on topic Input format for numbers

DenisChenu wrote: I really need to publish clearly my plugins ;)

gitlab.com/SondagesPro/QuestionSettingsType/jquerySimpleMask

Usage of github.com/igorescobar/jQuery-Mask-Plugin


What is the proper way to install this plugin? Thank you.
Last edit: 3 years 11 months ago by mdwhitby.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #198821 by Joffm
Replied by Joffm on topic Input format for numbers
Hi,
1. download from gitlab
2. Unzip and upload the folder to "/plugin" directory of your installation
3. Activate in "Configuration / Plugin manager"

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 11 months ago #198863 by DenisChenu
Replied by DenisChenu on topic Input format for numbers
Not 4.X compatible.

Currently no Question Attribute plugin can be 4.X compatible.

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