Last active
December 28, 2015 16:29
-
-
Save richardW8k/7529589 to your computer and use it in GitHub Desktop.
Activate input mask for list field columns. If no other field types have input masks enabled you will also need to enqueue the masked input script, see the following gist for an example https://gist.github.com/richardW8k/7529522
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
function ListFieldMaskedInput( formId, fieldId, column, mask ){ | |
jQuery( '.gfield_list_' + fieldId + '_cell' + column + ' input' ).mask( mask ); | |
jQuery( '#field_' + formId + '_' + fieldId ).on( 'click', '.add_list_item', function(){ | |
jQuery( '.gfield_list_' + fieldId + '_cell' + column + ' input' ).mask( mask ) | |
}); | |
} | |
ListFieldMaskedInput( 11, 2, 1, '9999' ); | |
/** | |
* Add a function call for each list field column you want to activate an input mask for | |
* ListFieldMaskedInput( formId, fieldId, column, 'mask' ); | |
* for examples of input masks see http://www.gravityhelp.com/documentation/page/Input_Mask | |
*/ | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment