Setting Properties in Form Controls (NopCommerce 3.90)

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
4 years ago
Hello guys!

I added new attributes to my model and now I want to configure them in the View.
I need to set minimum and maximum values for a couple of controls and set another control as checked by default.

Where in the definition of the control can I do that ?

@Html.NopEditorFor(model => model.PeriodoCompraInicio) < Maps as numeric picker, set minimum and maximum values
@Html.NopEditorFor(model => model.Activo)              < Maps as checkbox, set checked by default

Thanks a lot.
Regards,
4 years ago
Hi.

Try this:


@Html.TextBoxFor(model => model.ExpireMonth, new { style = "Width: 30px;", autocomplete = "off", maxlength = 2, required = "required", @type = "number", @pattern = "\\d*", min = 1, max = 12 })
4 years ago
I hope some attribute customization could be made to the NopEditor object but as I see now, it's not possible.
Thanks a lot!
Regards,
4 years ago
nop-world.com wrote:
Hi.

Try this:


@Html.TextBoxFor(model => model.ExpireMonth, new { style = "Width: 30px;", autocomplete = "off", maxlength = 2, required = "required", @type = "number", @pattern = "\\d*", min = 1, max = 12 })



I hope some attribute customization could be made to the NopEditor object but as I see now, it's not possible.
Thanks a lot!
Regards,
2 years ago
We've added support for custom attributes to NopEditorTagHelper. Please see this commit.

xavirm wrote:

I hope some attribute customization could be made to the NopEditor object but as I see now, it's not possible.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.