Submit on Click not on Return Key

First hurdle for me but one I know my clients will encounter regularly.

I was testing a form that I have created and simply hit the Return Key when completing one of the entry fields, this resulted in the form being submitted without any of the other fields being completed.

I know I can use form validations and required fields but the form has a number of fields that are optional and can be left blank, so the validations/required fields option won’t help me in this scenario.

Is there a way to only allow the form to be submitted on the click of the button rather than also on use of the Enter/Return Key?

Please help as this will cause me a massive headache.

Hi @JulianMc, welcome to the community!

You may remove the Enter/Return keybinding by adding the following to the JavaScript section of the page that contains the form.
Note: Change ‘component_3’ to your component id.

TB.render('component_3', function(data) {
  	 $(data.ele).find('form').unbind();
});

2 Likes

@Chem Thank you for the welcome and most importantly, Thank you for the solution…Worked a treat!

1 Like