Submit form on radio button choice

Hi I am trying to get a submit button to fire / click on a radio button I have used examples found on the internet but so far nothing working, any ideas / resources out there would be most appreciated.

Below doesn’t seem to work taken from an example that someone said does work . . . .

jQuery(function(){ jQuery(document).on(‘change’, ‘#input_1_1 input:radio’, function() { jQuery(document).find(’#gform_submit_button_1’).click(); });

Can you share a link to the page on your site, and let us know which radio button should be the one that submits the form? Thank you.

Hi Chris thanks for getting back. I would like any of the radio buttons ( which I have styled to look like boxes ) to submit the form / click next page when chosen. I have removed the code which wasn’t working , I tried a few variations found on the internet reported as “working” but they didn’t work, I tried a few methods of integration.

Thanks for your support.

Hello. Try this script:

<script>
  jQuery(document).ready(function($) {
    $('input[type=radio]').on('change', function() {
      $(this).closest("form").submit();
    });
  });
</script>

That worked for me with a form with one radio button field, to submit the form when a radio button selection was made. That script can go into an HTML field you add to the form.

I will give that a go, thanks so much for your generosity in helping me out Chris.

1 Like

You’re welcome.