Skip to content

Commit b647205

Browse files
committed
Merge pull request #2 from davidcarroll/InputNameFix
Fix issue where name was doubled up when using EditorFor.
2 parents 028290d + 96bbe24 commit b647205

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

jQuery.Validation.Unobtrusive.Native/CheckBoxExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public static IHtmlString CheckBoxFor<TModel>(this HtmlHelper<TModel> htmlHelper
3232
var value = (bool)ModelMetadata.FromLambdaExpression(expression, htmlHelper.ViewData).Model;
3333

3434
var checkBox = Mapper.GenerateHtmlWithoutMvcUnobtrusiveAttributes(() =>
35-
htmlHelper.CheckBox(metadata.PropertyName, value, attributes));
35+
htmlHelper.CheckBoxFor(expression, value, attributes));
3636

3737
return checkBox;
3838
}

jQuery.Validation.Unobtrusive.Native/DropDownListExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static IHtmlString DropDownListFor<TModel, TProperty>(this HtmlHelper<TMo
3636
var attributes = Mapper.GetUnobtrusiveValidationAttributes(htmlHelper, expression, htmlAttributes, metadata);
3737

3838
var dropDown = Mapper.GenerateHtmlWithoutMvcUnobtrusiveAttributes(() =>
39-
htmlHelper.DropDownList(metadata.PropertyName, selectList, optionLabel, attributes));
39+
htmlHelper.DropDownListFor(expression, selectList, optionLabel, attributes));
4040

4141
return dropDown;
4242
}

jQuery.Validation.Unobtrusive.Native/ListBoxExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static IHtmlString ListBoxFor<TModel, TProperty>(this HtmlHelper<TModel>
3434
var attributes = Mapper.GetUnobtrusiveValidationAttributes(htmlHelper, expression, htmlAttributes, metadata);
3535

3636
var listBox = Mapper.GenerateHtmlWithoutMvcUnobtrusiveAttributes(() =>
37-
htmlHelper.ListBox(metadata.PropertyName, selectList, attributes));
37+
htmlHelper.ListBoxFor(expression, selectList, attributes));
3838

3939
return listBox;
4040
}

jQuery.Validation.Unobtrusive.Native/RadioButtonExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public static IHtmlString RadioButtonFor<TModel, TProperty>(this HtmlHelper<TMod
3333
var attributes = Mapper.GetUnobtrusiveValidationAttributes(htmlHelper, expression, htmlAttributes, metadata);
3434

3535
var radioButton = Mapper.GenerateHtmlWithoutMvcUnobtrusiveAttributes(() =>
36-
htmlHelper.RadioButton(metadata.PropertyName, value, attributes));
36+
htmlHelper.RadioButtonFor(expression, value, attributes));
3737

3838
return radioButton;
3939
}

jQuery.Validation.Unobtrusive.Native/TextAreaExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static IHtmlString TextAreaFor<TModel, TProperty>(
3636
var attributes = Mapper.GetUnobtrusiveValidationAttributes(htmlHelper, expression, htmlAttributes, metadata);
3737

3838
var textArea = Mapper.GenerateHtmlWithoutMvcUnobtrusiveAttributes(() =>
39-
htmlHelper.TextArea(metadata.PropertyName, metadata.Model as string, rows, columns, attributes));
39+
htmlHelper.TextAreaFor(expression, rows, columns, attributes));
4040

4141
return textArea;
4242
}

jQuery.Validation.Unobtrusive.Native/TextBoxExtensions.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public static IHtmlString TextBoxFor<TModel, TProperty>(
3434
var attributes = Mapper.GetUnobtrusiveValidationAttributes(htmlHelper, expression, htmlAttributes, metadata);
3535

3636
var textBox = Mapper.GenerateHtmlWithoutMvcUnobtrusiveAttributes(() =>
37-
htmlHelper.TextBox(metadata.PropertyName, metadata.Model, format, attributes));
37+
htmlHelper.TextBoxFor(expression, format, attributes));
3838

3939
return textBox;
4040
}

0 commit comments

Comments
 (0)