Skip to content

Ignore hidden field if an input with the same name already exists #68

Open
@nathankoop

Description

@nathankoop

I use Asp.net MVC, when I use the @Html.EditorFor (or CheckboxFor) the Razor view engine generates two inputs, a checkbox and a hidden field. Both of these have the same id & name. (http://stackoverflow.com/questions/2860940/why-does-the-checkboxfor-render-an-additional-input-tag-and-how-can-i-get-the-v)

When I submit the form through the typical <form type='post' action='myurl'> ... <input type='submit'></form> then the MVC controller gets all the correct information, however when I use jquery ajax and this plugin (which I love btw), then the value for my field is overwritten by the hidden field's value.

I have put together a jsfiddle to repo this issue.
https://jsfiddle.net/8df7fc9k/1/

Thanks,

Nathan

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions