У меня есть код проверки jQuery для формы. Однако, когда я устанавливаю ie9 в режим браузера ie7 в инструментах разработчика, я получаю сообщение об ошибке, и проверка не работает.
Я не вижу, в чем может быть проблема?
Ошибка - строка}, над словом сообщение.
SCRIPT1028: Expected identifier, string or number
confirm, line 587 character 25
Код:
$().ready(function() {
// validate signup form on keyup and submit
$("#signupForm").validate({
rules: {
'data[User][email]': {required: true, email: true},
'data[User][firstname]': {required: true},
'data[User][surname]': {required: true},
'data[User][address1]': {required: true},
'data[User][city]': {required: true},
'data[User][state]': {required: true},
'data[User][phone]': {required: true, digits: true},
'user_terms': 'required',
'data[User][card_type]': {required: true},
'data[User][card_number]': {required: true, creditcard: true},
'data[User][card_type]': {required: true},
'data[User][card_name]': {required: true},
'data[User][card_cvv]': {required: true,digits: true, minlength: 3, maxlength:3 },
'data[User][card_expires]': {required: true}
}, // This is the line ie7 complains about
messages: {
UserEmail: {required: "Please enter a valid email address"},
UserFirstname: {required: "Please enter your firstname"},
UserSurname: {required: "Please enter your lastname"},
UserAddress1: {required: "Please enter your Address"},
UserCity: {required: "Please enter your City"},
UserState: {required: "Please enter your State"},
UserPhone: {required: "Please enter your Phone"},
user_terms: 'You must agree to the terms and conditions',
UserCardType: {required: "Please select your Card Type"},
},
errorPlacement: function(error, element) {
error.appendTo( element.parent().next() );
},
submitHandler: function() {
$('#checkoutBT').hide();
var $bookingNow = $('<div id="bookingNow" class="ui-button ui-widget ui-state-default ui-corner-all"><img src="https://www.treacyshotelwaterford.com/res360/res/app/webroot/images/forms/ajax-loader.gif" /> Booking Now</div>');
$('.checkout').append($bookingNow);
form.submit();
}
});