i have done a search button filter of from to date and made the fields as required but 8it's not working even though i checked console it shows the error as
jquery.min.js:2 jQuery.Deferred exception: $(...).validate is not a function TypeError: $(...).validate is not a function
at HTMLDocument.<anonymous> (http:
at e (http:
at t (http:
S.Deferred.exceptionHook @ jquery.min.js:2
t @ jquery.min.js:2
setTimeout (async)
(anonymous) @ jquery.min.js:2
c @ jquery.min.js:2
fireWith @ jquery.min.js:2
fire @ jquery.min.js:2
c @ jquery.min.js:2
fireWith @ jquery.min.js:2
ready @ jquery.min.js:2
B @ jquery.min.js:2
jquery.min.js:2 Uncaught TypeError: $(...).validate is not a function
at HTMLDocument.<anonymous> ((index):293:30)
at e (jquery.min.js:2:30038)
at t (jquery.min.js:2:30340)
i have mentioned the jquery .min.js in bundle config even tough i installed other version 3.6.0 i mentioned only min in bundle.config
What I have tried:
$("#searchForm").validate({
errorClass: "error-class",
validClass: "valid-class",
errorElement: 'div',
errorPlacement: function (error, element) {
if (element.parent('.input-group').length) {
error.insertAfter(element.parent());
} else {
error.insertAfter(element);
}
},
onError: function () {
$('.input-group.error-class').find('.help-block.form-error').each(function () {
$(this).closest('.form-group').addClass('error-class').append($(this));
});
},
rules: {
txtFromDate: { required: true },
txtToDate: { required: true }
},
messages: {
txtFromDate: "From Date Is Required",
txtToDate: "From Date Is Required",
},
submitHandler: function (form) {
$('#loading').show();
debugger;
$.ajax({
url: '/Report/GetProvCommReport',
type: 'GET',
data: {
fromDate: moment($('#txtFromDate').val(), 'DD/MM/YYYY').toISOString(),
fldToDate: moment($('#txtToDate').val(), 'DD/MM/YYYY').add(1, 'days').toISOString(),
},
error: function () {
$('#loading').hide();
var notify = $.notify('Error An error has occurred. Contact administrator.!', {
allow_dismiss: true,
type: 'danger'
});
return false;
},
success: function (data, status) {
alert(data)
if (status == 'success') {
table.clear().draw();
table.rows.add(data);
table.columns.apply().draw();
$('#loading').hide();
} else {
$('#loading').hide();
var notify = $.notify('Warning Error for reading online count details. Please contact administrator.!', {
allow_dismiss: true,
type: 'warning'
});
return false;
}
return false;
}
need help!