How do I submit call handler on radio button selection? I use the advanced polls module in Drupal 7. I am trying to alter the behaviour so that the vote is submitted as soon as the radio button is selected (without having to hit Vote).

The module is using an ajax callback:

$form['submit'] = array(
'#type' =&gt; 'submit',
'#ajax' =&gt; array(
  'callback' =&gt; 'advpoll_form_submit',
  'wrapper' =&gt; 'advpoll-form-' . $values-&gt;nid,
  'name' =&gt; 'submit1',
),
'#id' =&gt; 'edit-submit-advpoll-' . $values-&gt;nid,
'#value' =&gt; t('Vote'),


);

How can I invoke this callback with radio buttons?

I am happy for a quick and dirty javascript/jQuery solution as time is a real factor.

I have tried a jQuery solution:

$('input[type="radio"]').change(function() {
  $('#advpoll-form-296').trigger('click');
});


However this is not invoking the action as expected.

I cannot call submit() as I don't want to cause a page reload. 

I have managed to get my original code to fire by adding a click event to the ajax array in the .module file. 

advpoll.module:

function advpoll_choice_form($form, &amp;$form_state, $values) {

$form['submit'] = array(
'#type' =&gt; 'submit',
'#ajax' =&gt; array(
  'callback' =&gt; 'advpoll_form_submit',
  'wrapper' =&gt; 'advpoll-form-' . $values-&gt;nid,
  'name' =&gt; 'submit1',
  'event' =&gt; 'click', //Added click event
),
'#id' =&gt; 'edit-submit-advpoll-' . $values-&gt;nid,
'#value' =&gt; t('Vote'),


);

I am aware I should not override code within the module. How would I go about getting this into a theme hook?
This should do it:

$(function() {
  $('input[type="radio"]').on('change', function() {
    $(this).parents('form').submit();
  });
});


You might want to qualify the selector for $('input[type="radio"]') to the scope of the form you're working with, else if you include this in a JavaScript file that's accessed on many different pages, you'll definitely run into problems!

Demo:  http://plnkr.co/edit/8448bjiywnVtbT3CV6s6?p=info