DatePicker on Contact Us Page

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
10 Jahre weitere
Hi,

Could you some one help me how to display date picker on Contact Us Page.

I have added in Model
        [AllowHtml]
        [NopResourceDisplayName("ContactUs.StartDate")]
        public DateTime StartDate { get; set; }

Controller
DateTime StartDate = model.StartDate;

ContactUs.cshtml
                    <div class="inputs">
                        @Html.LabelFor(model => model.StartDate)
                        <div class="input-box">
                            @Html.TextBoxFor(model => model.StartDate, new { @class = "fullname", placeholder = T("ContactUs.StartDate.Hint") })
                        </div>
                        @Html.ValidationMessageFor(model => model.StartDate)
                    </div>


but not getting the date picker.
10 Jahre weitere
You have "TextBoxFor"  (why would you expect a date picker? :)

If you want a date picker like in the Register page, see how it's done for birth date in \Presentation\Nop.Web\Views\Customer\Register.cshtml
10 Jahre weitere
I just need all at one place(entire date). In the register page there are 3 drop downs.
10 Jahre weitere
You'll need to customize it.  Maybe you can use the kendo ui code as used in the Admin (e.g. the Product Edit page)

ProductModel.cs
        [NopResourceDisplayName("Admin.Catalog.Products.Fields.SpecialPriceStartDateTimeUtc")]
       [UIHint("DateTimeNullable")]
        public DateTime? SpecialPriceStartDateTimeUtc { get; set; }

\Presentation\Nop.Web\Administration\Views\Product\_CreateOrUpdate.Info.cshtml
            @Html.EditorFor(model => model.SpecialPriceStartDateTimeUtc)
            @Html.ValidationMessageFor(model => model.SpecialPriceStartDateTimeUtc)
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.