5

We need to store bank account numbers and will set up a CiviCRM custom field for the data. Ideally we would like the field to be such that people only enter data in the following format xx-xxxx-xxxxxxx-xxx. Is it possible to customise the custom field format? if so how would I do it?

Or do I need to create a work around eg have 4 integer fields that display inline with dashes inbetween.

3

I'd suggest adding a javascript formatter to a single, custom input text field. I haven't tried it, but formatter.js looks like it would deliver what you want.

Their Credit Card demo illustrates what you want - accepts pasting of data with and without hyphens, prevents pasting / input of values which don't match the validation rule. It just needs a different pattern for hyphen placement to deliver bank accounts.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.