Skip to content

If called copyViewValuesToModel the radio button with checked attribute in html gets checked and model gets the value. #199

@technikhil314

Description

@technikhil314

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions