I've run into a tricky problem it seems. I've got two input text fields that i've turned into datepickers. However when i pick a date the date does not transfer into the textfield. The calendar shows perfectly.
The project is in MVC 3 and has been programmed by some former employees. I've been looking through the code for the last couple of days now, and i've tried to change the version of jQuery. The project is running v. 1.5.1 by default. I've tried v. 1.6.4 v. 1.7.2 and v. 1.10.1, version 1.7.2 seems to be the latest valid version as the rest of the project also depend on jQuery. Later version seems to be creating some incompatibility.
Seems i've run into a wall here, and i'm hoping some of you out there can shine a little light for me.
Code defining the elements in my view:
<div style="margin-top: 10px">
<label><input id="enable-Periode" type="checkbox" @(Model.StartDate.HasValue || Model.EndDate.HasValue ? "checked=checked" : "") onclick="archiveMetaDataPlacement.enabledPeriod(this);" />Benyt periode</label>
<div style="margin: 10px 0 20px 0">
<label>Periode <input type="text" size="11" id="StartDate" name="StartDate" class="datepicker" value="@(Model.StartDate.HasValue ? Model.StartDate.Value.ToShortDateString() : "")" /></label> -
<label>Periode <input type="text" size="11" id="EndDate" name="EndDate" class="datepicker" value="@(Model.EndDate.HasValue ? Model.EndDate.Value.ToShortDateString() : "")" /></label>
</div>
...
<script>
$(".datepicker").datepicker();
</script>
The jQuery scripts is importet in the coherent "masterlayout":
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>@ViewBag.Title</title>
<link href="@Url.Content("~/Content/Core.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/Redmond/jquery-ui-1.8.14.custom.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/buttons-and-hovermenu.css")" rel="stylesheet" type="text/css" />
<!--[if IE 7]>
<link href="/Content/user/ie7fix.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/Scripts/json/json2.js"></script>
<![endif]-->
<script type="text/javascript" src="/scripts/jquery-1.7.2.js"></script>
<script type="text/javascript" src="/Scripts/jquery-ui-1.8.14.custom.min.js"></script>
<script src="/Scripts/jquery-ui-i18n.js" type="text/javascript"></script>
<script type="text/javascript" src="/scripts/admin/iportal.js"></script>
<script type="text/javascript" src="/global/globalization"></script>
@RenderSection("head", required: false)