/** * Check if masked input value is empty * If it is, move the cursor to the first position of the value mask */ jazelReady(function() { jQuery('.gform_wrapper input[type=text]').on('click', function (e) { var value = e.target.value; if ( /^[_(]{1}[_\s-x()/]+$/.test(value) ) { var offset = ( value[0] === '(' ) ? 1 : 0; e.target.setSelectionRange(offset, offset); } }); });