<?php | |
/** | |
* Move focus to next field after input mask completed | |
*/ | |
// update the "86" to the ID of your form | |
add_filter('gform_input_mask_script', 'gwiz_input_mask_focus_next', 10, 4); | |
function gwiz_input_mask_focus_next($script, $form_id, $field_id, $mask) { | |
$script = "jQuery('#input_{$form_id}_{$field_id}').mask('{$mask}', " . | |
"{ completed: function() { jQuery(this).parents('li.gfield').next('li.gfield').find('input').focus(); }}" . | |
").bind('keypress', function(e){if(e.which == 13){jQuery(this).blur();} } );"; | |
return $script; | |
} | |
?> |
Leave a Reply