I'm having problems with my jquery date validation script so I installed the jquery globlization package.I'm very new to packages and installation of packages so I'm not quite sure how to utilize the scripts. I tried doing the following but it still gives me this error.
Everything in the Scripts folder
Snippet in Views\User\Create.cshtml
<% Html.EnableClientValidation(); %>
<% using (Html.BeginForm())
{ %>
<%: Html.ValidationSummary(false) %>
<%: Html.EditorForModel() %>
<p> <input type="submit" value="Create" /></p>
<% } %>
</fieldset>
}
Views\User\Create.cshtml
@model RecreationalServicesTicketingSystem.Models.User
@{
ViewBag.Title = "Create";
}
<h2>Create</h2>
@using (Html.BeginForm()) {
@Html.AntiForgeryToken()
@Html.ValidationSummary(true)
<fieldset>
<legend>User</legend>
<div class="editor-label">
@Html.LabelFor(model => model.LastName)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.LastName)
@Html.ValidationMessageFor(model => model.LastName)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.FirstMidName)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.FirstMidName)
@Html.ValidationMessageFor(model => model.FirstMidName)
</div>
<div class="editor-label">
@Html.LabelFor(model => model.EnrollmentDate)
</div>
<div class="editor-field">
@Html.EditorFor(model => model.EnrollmentDate)
@Html.ValidationMessageFor(model => model.EnrollmentDate)
</div>
<% Html.EnableClientValidation(); %>
<% using (Html.BeginForm())
{ %>
<%: Html.ValidationSummary(false) %>
<%: Html.EditorForModel() %>
<p> <input type="submit" value="Create" /></p>
<% } %>
</fieldset>
}
<div>
@Html.ActionLink("Back to List", "Index")
</div>
@section Scripts {
@Scripts.Render("~/bundles/jqueryval")
}
I just needed to add en-NZ into this line of code found in jquery-ui-1.8.24.js and the date validation started to work
$.extend(this._defaults, this.regional['']);
$.extend(this._defaults, this.regional['en-NZ']);