javascript - Not getting change events when radio buttons are clicked -


mates, i'm tryin' set backbone events when radio buttons clicked. have following buttons:

<p><label for="pays">pays now</label><input id="pays" name="pays" type="radio" value="1" class="_100"/></p> <p><label for="pays2">pays later</label><input id="pays2" name="pays" type="radio" value="2" class="_100"/> 

and define event this:

'click input[name=pays]:not(:checked)': 'radiochecked' 

so, understand it, should fire when clicking input named pays that's not checked.

the thing is, not firing event when click on radio button.

if try this...

'click input[name=pays]': radioclicked 

i can fix flags, i'll have event fired every time radio clicked.

any idea? thanks!

i've found solution. changed event declaration to:

'click input[name=pays]:checked': 'onradioclick' 

so triggers when click on radio button named pays, , if use:

$('input[name=pays]:checked').val() 

i checked radio value, instead of first 1 declarated.

thanks!


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -