Submit form with event when checking radio bootflap buton

1

I'm using this responsive HTML library ( link ) and I want to submit a form when I click on a radio button. The problem is that as there are several "layers" of divs above the radio button, this is not checked directly, and then the submit event does not occur.

How can I resolve this?

Code

Before loading your browser:

<div style="position: relative;" class="iradio_flat">
<input type="radio" name="diploma" id="diploma" value="DS" onchange='this.form.submit();'>
</div>
<label id="diploma_DS" class="radio_label" for="diploma">Diploma</label>

After loading the browser:

<div style="position: relative;" class="iradio_flat">
    <div class="iradio_flat checked" style="position: relative;">
        <input name="diploma" id="diploma" value="DS" checked="" onchange="this.form.submit();" style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;" type="radio">
        <ins class="iCheck-helper" style="position: absolute; top: -20%; left: -20%; display: block; width: 140%; height: 140%; margin: 0px; padding: 0px; background: rgb(255, 255, 255) none repeat scroll 0% 0%; border: 0px none; opacity: 0;"></ins>
    </div>
</div>
<label id="diploma_DS" class="radio_label" for="diploma">Diploma</label>
    
asked by anonymous 29.10.2017 / 01:14

1 answer

0

If your radio button is "overwritten" after the page finishes loading and you want it to be that way, or you can not easily change it, assign the click event to the element that is "above" your radio button.

To verify this press the right button on it and go to the option "inspect element" of your browser and find exactly the selector that should assign the click event.

Assign an id in your form and modify the example below for your reality:

$(function() {
    $('#div_que_esta_por_cima').click(function() {
        $('#id_do_formulario').submit();
    });
});
    
29.10.2017 / 02:56