Setting Properties in Form Controls (NopCommerce 3.90)

Posted: May 01, 2019 at 12:52 PM Quote #230726
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,
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: May 01, 2019 at 7:42 PM Quote #230773
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 })
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Please vote UP the answer if it helps you!

https://www.nop-world.com - World's best plugins for nopCommerce
----------------------------------------------------------------------------------------------------
plugins, widgets, customizations, improvements, SEO, performance & more!
Posted: May 02, 2019 at 10:54 AM Quote #230830
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,
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Posted: May 02, 2019 at 10:55 AM Quote #230831
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,
This post/answer is useful
0
This post/answer is not useful

Please login or register
to vote for this post.

(click on this box to dismiss)
Premium support services
  • Dedicated premium support services provided by core developers are intended for persons who run mission critical websites, work on projects with tight deadlines, or want to get dedicated support.
Professional services
  • Want to open a new store? Want to take your store to the next level? Need a custom extension? We can customize nopCommerce to fit your store perfectly. Request a quote to get started.
eCommerce CONFERENCE 2019
Learn more