Setting Properties in Form Controls (NopCommerce 3.90)

7 months 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,
7 months 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 })
7 months 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,
7 months 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,