I am trying to get DatePicker for my MVC Popup but its not working can you please help.
I am New to MVC and Jquery.
I am getting this Error "0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'datepicker'"
I am trying to get DatePicker for my MVC Popup but its not working can you please help.
I am getting this Error "0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'datepicker'"
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Mayank GaurPosted May 5, 2017, 12:34 AM
Bidyasagar MishraPosted May 4, 2017, 3:12 AM
Dharmraj ThakurPosted May 2, 2017, 4:51 AM
Manav PandyaPosted May 2, 2017, 4:46 AM
Rajkiran SwainPosted Apr 28, 2017, 6:01 AM
Megna MusapetaPosted Apr 28, 2017, 2:19 AM
@Mayank, Thanks a lot for your help, I tried the code which you have give, now i am getting this error.
Manas MohapatraPosted Apr 27, 2017, 1:02 AM
Mayank GaurPosted Apr 27, 2017, 12:41 AM
I have changed in your file plz check,Is it now working
Megna MusapetaPosted Apr 18, 2017, 2:40 AM
Megna MusapetaPosted Apr 18, 2017, 2:39 AM
I Added the datepicker in the Partial View.
@model CRWeb2.Models.ComplianceReportModel
Set Exception Flag
Instance Name
@{
if(Model.ListComplianceReportExceptionDetails != null )
{
@Html.LabelFor(m => m.ListComplianceReportExceptionDetails.InstanceName, new { @id = "lblInstanceName"})
}
else
{
@Html.LabelFor(m => m.InstanceName, htmlAttributes: new { @id = "lblInstanceName" })
}
}
@if (Model.ExceptionFlag || Model.ListComplianceReportExceptionDetails == null)
{
}
else
{
}
@Html.HiddenFor(m => m.ExceptionFlag)
@Html.CheckBoxFor(m => m.ListServerExceptionDocument.DocumentUploaded, new {@id = "CHKDOCUploaded", @checked = "checked" })
@{
if (@Model.ListServerExceptionDocument != null)
{
@Html.TextBoxFor(m => m.ListServerExceptionDocument.ExpirationDate, new { @id = "txtExpirationDate" })
//@Html.TextBoxFor(m => m.ListComplianceReportExceptionDetails.JobOwner, new { @id = "txtExpirationDate" })
}
else
{
}
}
function SaveDetails()
{
var DocUploaded = $("#ddlUploaded").val();
var ExpDat = $("#txtExpirationDate").text();
alert(DocUploaded);
alert(ExpDat);
@*$.ajax({
url: '@Url.Action("CRExceptionTypes", "ComplianceReport")',
data: { ExceptionType: ExceptionType, InstanceName: InstanceName },
type: "POST",
success: function (result) {
$("#DVExceptionDetails").empty();
$("#DVExceptionDetails").html(result);
}
});*@
$("#DVExceptionDetails").css("display", "none")
}
//$(document).ready(function () {
// $("#txtExpirationDate").datepicker({
// format: "dd/mm/yyyy",
// orientation: "top"
// });
//});
//$(document).ready(function () {
// $("#txtExpirationDate").datepicker({
// changeMonth: true,
// changeYear: true
// });
//});
//$.validator.addMethod('date', function (value, element) {
// if (this.optional(element)) {
// return true;
// }
// var valid = true;
// try {
// $.datepicker.parseDate('dd/mm/yyyy', value);
// }
// catch (err) {
// valid = false;
// }
// return valid;
//});
//$(function () {
////$(document).ready(function () {
// $('#txtExpirationDate').datepicker({
// format: 'MM/DD/YYYY',
// autoclose: true
// })
// });
// $(document).ready(function() {
// $('#txtExpirationDate').datepicker();
//});
@*
Date:
*@@*
$(document).ready(function () {
$("#txtExpirationDate").datepicker({
changeMonth: true,
changeYear: true
});
});
*@
$( function() {
$("#txtExpirationDate").datepicker();
} );
$(document).ready(function () {
$('#SaveDetails').click(function () {
var DocumentUploaded = $('#lblInstanceName').text();
var ExpirationDate = $('#txtExpirationDate').text();
alert(DocumentUploaded);
alert(ExpirationDate);
$('#loadingPanel').show();
$.ajax({
url: "CRList.cshtml/SaveData",
type: "POST",
dataType: "json",
contentType: "application/json; charset=utf-8",
data: JSON.stringify({
"DocumentUploaded": DocumentUploaded,
"ExpirationDate": ExpirationDate
}),
success: function (data) {
if (data.d == "success") {
alert("Data saved successfully");
$('#<%=ddlUploaded%>').val('');
$('#<%=txtExpirationDate%>').text();
}
},
Error: function (xhr, ajaxOptions, thrownError) {
alert(thrownError);
}
}).done(function () {
$('#loadingPanel').hide();
});
});
});
Nigel FernandesPosted Apr 18, 2017, 1:50 AM
Megna MusapetaPosted Apr 18, 2017, 1:39 AM
@**@
@**@
@**@
@**@
@**@
@**@
@*
*@
@*
*@
@Styles.Render("~/Content/css")
@*@Scripts.Render("~/bundles/modernizr")*@
@{
ViewBag.Title = "List Of Servers";
var grid = new WebGrid(source: Model.ListComplianceExceptionReportDetails, canPage: true, rowsPerPage: 10);
grid.Pager(WebGridPagerModes.All);
}
Compliance Report
//var SelectedException = $("#DDLExceptionType:selected").text();
var SelectedDBA = $("#ddlDBA").val();
var SelectedInstance = $("#ddlInstance").val();
//alert(SelectedDBA);
//alert(SelectedException);
if (SelectedDBA != "" || SelectedInstance != "") {
var formData = $(this).serialize();
url: '@Url.Action("CRList", "ComplianceReport")',
data: { PrimaryDBA: SelectedDBA, InstanceName: SelectedInstance },
type: "POST",
success: function (result) {
$("#InstanceList").empty();
$("#InstanceList").html(result);
}
});
}
}
{
$.ajax({
url: '@Url.Action("CRExceptionTypes", "ComplianceReport")',
data: { ExceptionType: ExceptionType, InstanceName: InstanceName },
type: "POST",
success: function (result) {
$("#DVExceptionDetails").empty();
$("#DVExceptionDetails").html(result);
}
});
$("#DVExceptionDetails").css("display", "block")
}
function closepopup()
{
$("#DVExceptionDetails").css("display", "none")
}
// format: "dd/mm/yyyy",
// orientation: "top"
// });
//});
//});
@**@
Nigel FernandesPosted Apr 17, 2017, 8:36 PM
Megna MusapetaPosted Apr 17, 2017, 4:45 PM
Nigel, did you reply on my post, but iam unable to see, can you please check and let me know, I need this working i am trying from past month but no luck:(
Nigel FernandesPosted Apr 16, 2017, 11:55 PM
Megna MusapetaPosted Apr 15, 2017, 4:56 PM
Megna MusapetaPosted Apr 14, 2017, 5:01 PM
Nigel FernandesPosted Apr 10, 2017, 11:53 PM
Nigel FernandesPosted Apr 10, 2017, 11:52 PM
Megna MusapetaPosted Apr 10, 2017, 10:49 PM
Nigel FernandesPosted Apr 10, 2017, 9:42 PM
Megna MusapetaPosted Apr 10, 2017, 4:43 PM
Compliance Report
Date:
*@Nigel FernandesPosted Apr 9, 2017, 11:23 PM