имам проблем с инструмента за избор на дата и час от този сайт:
http://trentrichardson.com/examples/timepicker/
това е js-кодът:
var dates = $("#ArrivalStartDatepicker").datetimepicker({
defaultDate: "+lw",
dateFormat: 'dd-mm-yy',
changeMonth: true,
numberOfMonths: 2,
ampm: true,
stepMinute: 10,
minuteGrid: 10,
onSelect: function (selectedDate) {
// var option = this.id == "ArrivalStartDatepicker" ? "minDate" : "maxDate",
// instance = $(this).data("datetimepicker"),
document.getElementById("TotalLabel").value = $.datetimepicker.parseDate('yy-mm-dd', '2012-05-23');
// instance.settings.dateFormat ||
// $.datetimepicker._defaults.dateFormat,
// selectedDate, instance.settings);
// dates.not(this).datetimepicker("option", option, date);
// document.getElementById("TotalLabel").value = date;
}
});
ето моят html код за инструмента за избор на дата и време
<div class="txtTravel" id="DatetimePickerContainer1">
<input id="ArrivalStartDatetimepicker" type="text" name="datetimepicker" placeholder="dd-mm-yyyy hh:mm am"/>
</div>
това е главата на този .aspx-сайт
<%@ Page Title="GH" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="GH.aspx.cs" Inherits="GBCalc.GH" MaintainScrollPositionOnPostback="True"%>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
<link rel="stylesheet" type="text/css" href="/bgStyles/timepicker.css" />
<link href="/bgStyles/base/jquery.ui.base.css" rel="stylesheet" type="text/css" />
<link href="/bgStyles/base/jquery.ui.all.css" rel="stylesheet" type="text/css" />
<link href="/bgStyles/base/jquery.ui.theme.css" rel="stylesheet" type="text/css" />
<style type="text/css">
div.txtGeneral{position: relative; left: 110px; top: 55px; margin-top: 1.5px;}
div.lblGeneral{position:relative; left: -6px; top: 75px; margin: 1.5px; font-size: small;}
div.txtJob{position: absolute; top: 92px; left: 520px; }
div.lblJob{position: absolute; top: 92px; left: 370px; font-size: small;}
div.txtTravel{position: relative; left: 200px; top: 70px;}
div.lblTravel{position: relative; left: 0px; top: 90px; margin: 1.5px; font-size: small;}
div.txtWork{position: relative; left: 250px; top: 0px;}
div.lblWork{position: relative; left: 20px; top: 20px; margin: 1.5px; font-size: small;}
div.lblMisc{position: relative; left: -5px; top: -1px; margin: 1.5px; font-size: small;}
div.txtMisc{position: relative; left: 170px; top: -20px;}
</style>
<script src="Scripts/ui/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="Scripts/ui/jquery-ui-1.8.20.custom.min.js" type="text/javascript"></script>
<script src="Scripts/ui/jquery-ui-timepicker-addon.js" type="text/javascript"></script>
<script src="Scripts/ui/molschaua.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<asp:DropDownList ID="SubsidiaryCalcDropDownList" runat="server"
ToolTip="Subsidiary maker of the Calculation">
</asp:DropDownList>
<br />
<br />
<div id="MyAccordion">
проблемът е, че datetimepicker се показва, ако отворя сайта, но веднага щом избера дата или час, firebug извежда грешка, наречена "$.datetimepicker е недефиниран"
тази грешка се хвърля в този ред "document.getElementById("TotalLabel").value = $.datetimepicker.parseDate('yy-mm-dd', '2012-05-23');
"
Исках да премина през стойността, която избрах в инструмента за избор на дата и време, към моите методи на c# codebehind. къде ми е проблема?
Импортирах всички необходими js файлове и по мое мнение получих правилния ред как ги импортирах.
поздравявам
Тоби