Turn enter key into tab for Gravity Form

Add the following script using the wp_footer hook or into an existing javascript .js file to advance the cursor when the enter key is pressed.

jQuery(document).on('keypress','.gform_wrapper',function(e){
   var code = e.keyCode || e.which;
   if (code==13 && !(jQuery(e.target).is("textarea,input[type='button'],input[type='submit']"))){
      e.preventDefault();
      var li = jQuery(e.target).closest('.gfield_visibility_visible');
      var nxtli = li.next('.gfield_visibility_visible');
      var nxt = nxtli.find('.ginput_container');
      var f = nxt.find('input[type=text],input[type=password],input[type=radio],input[type=checkbox],textarea,select').filter(':visible:first');
      if (f)
         f.focus();
      return false;
   }
});;