2014-04-18 19.49.56The Gravity Forms support guys helped me with the recent issue, that I wanted to document for future use.

I had a multi-page form, the first page of which was a large, single text field and a big “NEXT” button.  I wanted the form to advance to page two on either a click of the button (easy!) or when the user pressed the enter key having filled in the text field. The support team passed me a helpful snippet:

<script>
jQuery('#input_1_1').on('keypress', function(e) {
     if (e.which == 13) {
         jQuery('#gform_next_button_1_7').trigger('click');
     }
});
</script>

You’ll need to get this added to your page in the right place, but that shouldn’t be too hard. And you’ll need to change the IDs of the input and next button to make it work with your form.

In hindsight I could easily have come up with this myself. I raised the support ticket thinking that there might be a built-in way that Gravity Forms could do this. There isn’t. You need this snippet!