Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

radio button(with click event) not passing the parameter in firefox

I have radio buttons embedded in my form as

<%= f.radio_button :name_present,true,:class => "namePresent"%>
<%= f.radio_button :name_present,false,:class => "namePresent"%>

and my application.js file contains

$(".namePresent").live('click',function(e){

     $("#form").submit();
//form is the id of my form_for
 });

All parameters are passed in chrome, but in firefox parameter from radio buttons are not passed.

like image 899
Apurva Mayank Avatar asked Nov 23 '25 14:11

Apurva Mayank


1 Answers

I should point out that live and bind are both deprecated. You can perform both with .on()

Try:

$(".namePresent").on('click',function(e){

   $("#form").submit();
//form is the id of my form_for
 });

Look at the link .

like image 172
Vik Avatar answered Nov 25 '25 03:11

Vik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!