[jQuery] Exception errors when using validation rules
Hi everyone, i'm getting a weird exception with 1.3.1 please see the
video link to watch what happens.
http://screencast.com/t/4Ih9rhKwZP
and if you don't watch the video i'm doing an ajax submit but it's
refreshing the page and throwing the error
exception:
[Exception... "'Syntax error, unrecognized expression:
[@for='license']' when calling method:
[nsIDOMEventListener::handleEvent]" nsresult: "0x8057001e
(NS_ERROR_XPC_JS_THREW_STRING)" location: "<unknown>" data: no]
jquery
var container = $('div.container');
$('#addlicense').validate({
submitHandler: function() {
$.ajax({
type: 'POST',
url: 'process.php?cmd=addlicense',
dataType: 'html',
data: { issuedby: $('#issuedby').val(), license: $
('#license').val(), licensenum: $('#licensenum').val(), issueddate: $
('#issueddate').val(), expiredate: $('#expiredate').val(), licenseid: $
('#licenseid').val(), action: $('#action').val(), noexpire: $("input
[name='noexpire']:checked").val() },
success: function(data){
$('#licenseresult').prepend(data);
},
error: function(){
alert("An error has occurred. Please try again.");
},
complete: function() {
$('#results').fadeIn('slow');
$('#licensenew').colorBlend([{ fromColor: '#F3F3F3', toColor:
'#33CC33', param: 'backgroundColor', cycles: 1 }]);
$("#addlicense").slideUp();
$("#nolicense").hide();
$("#licensectr").show();
}
});
return false;
},
errorContainer: container,
errorLabelContainer: $("ul", container),
wrapper: 'li',
meta: "validate",
rules: {
license: {
required: true
},
licensenum: {
required: true
},
issuedby: {
required: true
},
issueddate: {
required: true
},
expiredate: {
required: {
required: true,
depends: function(element) {
return $("#noexpire:checked")
}
}
}
},
messages: {
license: {
required: "License Name Description is required"
},
licensenum: {
required: "License number ID is required"
},
issuedby: {
required: "Issued by is required"
},
issueddate: {
required: "Date Issued is required"
},
expiredate: {
required: "Expires On is required"
}
}
});