Hi guys,
i have been trying to use kendo window to pop up when ever a user enters wrong credentials. But when the page load for the first time it pop ups.
I tryed to change the visibility to "false" and to "true". when visibility is set to false, the window does not show any more. when visibility is set to true, the dialog window shows when the page loads for the first time.
Here is the code that im using below...
<
script
>
$(document).ready(function () {
var myWindow = $("#Popdiv"),
undo = $("#submit");
undo.click(function (e) {
// e.preventDefault();
});
$("#okayButton").kendoButton({
click: function (e) {
myWindow.data("kendoWindow").close();
}
});
//$("#submit").click(function () {
// ValidateUsertwo();
// });
function onClose() {
undo.fadeIn();
}
myWindow.kendoWindow({
width: 600,
title: "Error",
modal: true,
iframe: true,
actions: [
'Pin',
'Close',
'Refresh'
],
close: onClose,
visible: true
}).data("kendoWindow").center();
});
function ValidateUsertwo() {
var ID = document.getElementById('<%:Html.IdFor(t => t.UserName) %>').value;
var pass = document.getElementById('<%:Html.IdFor(t => t.Password) %>').value;
if (ID == "") {
myWindow.data("kendoWindow").open();
return false;
}
if (pass == "") {
return false;
}
if ('@TempData["msg"]' != "") {
myWindow.data("kendoWindow").open();
}
}
//$("#button").on("click", function (e) {
// mywin.data("kendoWindow").close();
//});
</
script
>
help will be appreciated
thanks