Mask Character in UK Bank Sort Codes

More
1 month 2 weeks ago #192527 by 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

Please Log in or Create an account to join the conversation.

LimeSurvey Partners
More
1 month 2 weeks ago #192534 by 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 .

Please Log in or Create an account to join the conversation.

More
1 month 2 weeks ago #192537 by 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.

Please Log in or Create an account to join the conversation.

More
1 month 2 weeks ago #192538 by Joffm


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

Please Log in or Create an account to join the conversation.

More
1 month 2 weeks ago - 1 month 2 weeks ago #192539 by 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:

File Attachment:

File Name: limesurvey...5696.lss
File Size: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
Attachments:
Last edit: 1 month 2 weeks ago by tpartner.
The following user(s) said Thank You: DenisChenu, marcgold, Joffm

Please Log in or Create an account to join the conversation.

More
1 month 2 weeks ago #192570 by 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

Please Log in or Create an account to join the conversation.

More
1 month 2 weeks ago - 1 month 2 weeks ago #192572 by DenisChenu

marcgold wrote: @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 .
Last edit: 1 month 2 weeks ago by DenisChenu.

Please Log in or Create an account to join the conversation.

Start now!

Just create your account and start using Limesurvey today.

Register now
Join our Newsletter!