This add-on for Gravity Forms adds the option to validate if the users’ input is a valid IBAN bank account number.
The check is done when the user submits the form and it will show an error if the input is not correct. Only if this error is resolved the form can be actually be submitted.
In case of an invalid IBAN account number, the default Gravity Forms error message will be displayed in the language that Gravity Forms is set up in.
By installing this plugin besides Gravity Forms (premium plugin) you will be able validate IBAN account numbers through two ways:
[____ ____ ____ __]
). It validates the account number when submitting the form.(optional) You can set the max length of the IBAN mask in the Single Line Text field.
Default this is set to 32 since that is the length of IBAN numbers for Saint Lucia and Nicaragua. To override this default you can set it to 18 (NL) or 22 (DE) for example.
Beware! If you set this to 18 and someone needs to fill in an IBAN of 22, that will not work and that might throw your visitor/client off.
Open wp-config.php
and replace the following comment:
/* That’s all, stop editing! Happy blogging. */
…with the following piece of code:
define('GF_IBAN_LENGTH', '22'); /* That's all, stop editing! Happy blogging. */
(optional) You can also change the way the maks is shown by using a WordPress filter. You can, for example, remove all spaces from the mask.
For this to keep working we strongly advise you to use a Child Theme (read official WordPress docs ») so your changes are not lost when your theme updates.
Open [child-theme]/functions.php
and add the following code to the bottom of that file:
add_filter( "gform_input_mask_script", function($script, $form_id, $field_id, $mask) { if ($mask == "iban") { $mask_length = defined('GF_IBAN_LENGTH') ? (int) constant('GF_IBAN_LENGTH') : 18; $mask_string = rtrim( chunk_split( str_repeat( '*', $mask_length - 4), 4, ''), ''); $script = "jQuery('#input_{$form_id}_{$field_id}').css('text-transform','uppercase').mask('aa99?{$mask_string}');"; } return $script; }, 10, 4 );
(optional) You can disable the requirement of the php-iban library when it’s already loaded in another plugin.
Open wp-config.php
and replace the following comment:
/* That’s all, stop editing! Happy blogging. */
…with the following piece of code:
define('GF_IBAN_PHPIBAN', false); /* That's all, stop editing! Happy blogging. */
You just might want to validate a IBAN account in a Gravity Form, or help the visitor ensure he filled in his IBAN number correctly. Let us help you do so!
Version 1.0.6
Release Date: July 6th, 2023
Version 1.0.4
Release Date: October 11th, 2021
Version 1.0.3
Release Date: May 15th, 2020
Version 1.0.2
Release Date: May 13th, 2020
Version 1.0.1
Initial release