Mask Character in UK Bank Sort Codes

Mehr
1 Monat 2 Wochen her #192527 von marcgold
We have a survey setup to collect bank details as part of the survey.
UK Sort Codes (the code for a specific Bank Branch) are 6 digits long and are 3 sets of 2 digits each.

Often they are written:

Option 1: 00-00-00 (dash separated) or
Option 2: would be laid out as 3 separate fields of 2 numerics each like this [ ] - [ ] - [ ]

The dashes are only for display only and are not needed on the export. In fact it makes it a mess if they are exported.

Does anyone have any bright ideas on how we could achieve this.


Limesurvey Version 3.21

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

LimeSurvey Partners
Mehr
1 Monat 2 Wochen her #192534 von DenisChenu
Hi,

If i remind you can install plugin ?
gitlab.com/SondagesPro/QuestionSettingsType/jquerySimpleMask

See igorescobar.github.io/jQuery-Mask-Plugin/ for sample

You need to use text question type and for mask : 00-00-00

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 .
An error happen ? Before make a new topic : remind the Debug mode .

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Monat 2 Wochen her #192537 von marcgold
Hi Denis,

Thanks for this very useful for others areas, but unfortunately doesn't quite meet this use case.

The problem is that I only want to show the mask on the front end to assist the user. Currently I have the field set to Short Text 6 Chars Long and Numbers Only.

The Mask I have used is 00-00-00

The plugin breaks that logic i'm afraid as it actually adds the "-" into the field meaning its no longer a number. The other issue is when you export this it exports the "-" as well - which really messes with our process.

What I was hoping was a Mask that is for display only.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Monat 2 Wochen her #192538 von Joffm


Volunteers are not paid.
Not because they are worthless, but because they are priceless

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Monat 2 Wochen her - 1 Monat 2 Wochen her #192539 von tpartner
You can use RobinHerbots Inputmask plugin with the "removeMaskOnSubmit" option to remove unwanted characters in the data.

<script src="https://cdnjs.cloudflare.com/ajax/libs/inputmask/4.0.9/jquery.inputmask.bundle.min.js"></script>
<script type="text/javascript" charset="utf-8">
	$(document).on('ready pjax:scriptcomplete',function(){ 
		$('#question{QID} input[type="text"]').inputmask({
			'mask': '99-99-99',
			'placeholder': '_',
			'removeMaskOnSubmit': true,
			'rightAlign': false
		});
	});
</script>

Sample survey attached:

Dateianhang:

Dateiname: limesurvey...5696.lss
Dateigröße:15 KB

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Official LimeSurvey Partner - partnersurveys.com
Anhänge:
Letzte Änderung: 1 Monat 2 Wochen her von tpartner.
Folgende Benutzer bedankten sich: DenisChenu, marcgold, Joffm

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Monat 2 Wochen her #192570 von marcgold
Thank you all so much for some excellent ideas. Tpartners solution is the one that best and easily fits the use case.

Denis's solution is the most comprehensive and being a plugin is the easiest to implement across multiple uses.

@DenisChenu - Is there any way to add the function "'removeMaskOnSubmit': true," that is in the JS into the plugin - this would make your plugin just perfect

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Mehr
1 Monat 2 Wochen her - 1 Monat 2 Wochen her #192572 von DenisChenu

marcgold schrieb: @DenisChenu - Is there any way to add the function "'removeMaskOnSubmit': true," that is in the JS into the plugin - this would make your plugin just perfect

No, it's not the same plugin.

But can unmask when submit … but still : value is not number … then limesurvey show a JS error.

Maybe the other plugin can return "real' value too when using .val() in JS ?

PS : OK : github.com/RobinHerbots/Inputmask#autounmask is here.

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 .
An error happen ? Before make a new topic : remind the Debug mode .
Letzte Änderung: 1 Monat 2 Wochen her von DenisChenu.

Bitte Anmelden oder Registrieren um der Konversation beizutreten.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha