Open technikhil314 opened 9 years ago
Hi @nikhil-001mehta,
I would favor el.prop('checked')
myself, but I agree that el.attr('checked')
seems fishy/off there. If you get a chance, would you mind seeing if using prop
will work too?
Did you want to open a pull request to fix this, or would you like me or someone else to do so?
Hi @platinumazure
I yes the prop is working.so I will open a pull request soon.
this seems to have been fixed
I had written html with a group of radio buttons, in which I had added checked attribute to first radio button to make it checked by default when view is rendered. On the same form on change event of another element I had called copyViewValuesToModel function.After adding the call I find that the radio which had checked attribute gets checked though if I had changed the selection in radio button group.On debugging I found on line 303 of backbone.modelbinder.js the code is if(el.attr('type') === 'radio' && el.attr('checked')) which should be if(el.attr('type') === 'radio' && el.is(':checked')). Correct me if I am wrong.