i have tried multiple ways to allow this function to work - referred to a variety of jquery... and none work. can someone tell me what i'm doing wrong. i read its the order of how things are referred to... i tried changing that. i read its the bundle config... i edited that. i read its the jquery version.. i changed that... i read abt migrate... did that... nothing seems to work. i dont understand what i'm doing wrong.
EDIT removed some lines from head tag. left with the following. but the .valid is still not working..:
<head>
<meta charset="utf-8" />
<title>@ViewBag.Title - COMIS</title>
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
<link href="~/Content/themes/base/jquery.ui.core.css" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" />
<link href="@Url.Content("~/Content/themes/base/jquery.ui.theme.css")" rel="stylesheet"
type="text/css" />
<script src="~/Scripts/jquery-1.11.1.js" type="text/javascript"></script>
<script src="~/Scripts/jquery-migrate-1.2.1.js" type="text/javascript"></script>
<script src="~/Scripts/datepicker.js" type="text/javascript"></script>
<script src="~/Scripts/jquery.validate.js" type="text/javascript"></script>
<script src="~/Scripts/jquery.validate.unobtrusive.js" type="text/javascript"></script>
<meta name="viewport" content="width=device-width" />
@Styles.Render("~/Content/css")
@Styles.Render("~/Content/themes/base/css")
@Scripts.Render("~/bundles/modernizr")
@Scripts.Render("~/bundles/jquery")
@Scripts.Render("~/bundles/jqueryui")
@Scripts.Render("~/bundles/jqueryval")
@Scripts.Render("~/Scripts/buttons.js")
@Scripts.Render("~/Scripts/navigation.js")
function
$(function () {
global.initButtons();
});
var global = {
initButtons: function () {
$('a.button.positive').click(function (e) {
e.preventDefault();
var parentForm = $(this).closest('form');
if (!parentForm.valid()) {
$("form").validate();
// global.flashMessage('Error validating these values', 'error');
}
else {
$(this).css(global.disableCss).unbind('click');
parentForm.submit();
}
});
},
disableCss: { opacity: 0.5, display: 'inline-block' }
};