|
82 | 82 | @if (Model.CountryEnabled)
|
83 | 83 | {
|
84 | 84 | <div class="form-group row">
|
85 |
| - @Html.LabelFor(model => model.CountryId, new { @class = "col-{0}-3 col-form-label required".FormatInvariant(breakpoint) }) |
| 85 | + @Html.LabelFor(model => model.CountryId, new { @class = "col-{0}-3 col-form-label{1}".FormatInvariant(breakpoint, Model.CountryRequired ? " required" : "") }) |
86 | 86 | <div class="col-@breakpoint-9">
|
87 | 87 | @Html.DropDownList("CountryId", Model.AvailableCountries,
|
88 |
| - new |
89 |
| - { |
90 |
| - @class = "form-control country-input country-selector", |
91 |
| - data_region_control_selector = "#Address_StateProvinceId", |
92 |
| - data_states_ajax_url = Url.Action("GetStatesByCountryId", "Country"), |
93 |
| - data_addEmptyStateIfRequired = "true" |
94 |
| - }) |
| 88 | + new |
| 89 | + { |
| 90 | + @class = "form-control country-input country-selector", |
| 91 | + data_region_control_selector = "#Address_StateProvinceId", |
| 92 | + data_states_ajax_url = Url.Action("GetStatesByCountryId", "Country"), |
| 93 | + data_addEmptyStateIfRequired = "true" |
| 94 | + }) |
95 | 95 | @Html.ValidationMessageFor(model => model.CountryId)
|
96 | 96 | </div>
|
97 | 97 | </div>
|
|
100 | 100 | @if (Model.CountryEnabled && Model.StateProvinceEnabled)
|
101 | 101 | {
|
102 | 102 | <div class="form-group row">
|
103 |
| - @Html.LabelFor(model => model.StateProvinceId, new { @class = "col-{0}-3 col-form-label".FormatInvariant(breakpoint) }) |
| 103 | + @Html.LabelFor(model => model.StateProvinceId, new { @class = "col-{0}-3 col-form-label{1}".FormatInvariant(breakpoint, Model.StateProvinceRequired ? " required" : "") }) |
104 | 104 | <div class="col-@breakpoint-9">
|
105 | 105 | @Html.DropDownListFor(model => model.StateProvinceId, Model.AvailableStates, new { @class = "form-control" })
|
106 | 106 | @Html.ValidationMessageFor(model => model.StateProvinceId)
|
|
0 commit comments