I am using a jquery.validation plugin to validate my inputs on the form
I use it as follows:
$(document).ready(function () {
jQuery(function () {
// You can specify some validation options here but not rules and messages
jQuery('form[id="reservationForm"]').validate({ ignore: ":not(:visible)" });
$("#adult1Birthdate").mask("9999-99-99");
$("#reservationPersonBirthdate").mask("9999-99-99");
$("#adult1Firstname").rules("add", { required: true, minlength: 2, messages: { required: '<span style="color:Red">Pole wymagane</span>'} });
});
});
I get the following error however:
element is undefined
in the following line:
var settings = $.data(element.form, 'validator').settings;
What am I doing wrong?
**EDIT**
Also the following code does not work when I use jquery.validation
$(document).ready(function () {
$(function () {
$('a[id^="regionDetails"]').click(function () {
var vid_id = $(this).attr("id").replace("regionDetails", "#regionDetailsArea");
$('div[id^="regionDetailsArea"]').hide();
$(vid_id).show();
return false;
});
});
});
If you’re using
$, don’t usejQuery. Try this: