-2

I was wondering if some one could help me close the code correctly. I have tried to close it in jsFiddle and on the page but somewhere I am mission one of } or ) or ;

Here is the code below and help is appreciated:

// validate form and submit
var $j = jQuery.noConflict();
$j(document).ready(function(){
$j("#myform").validate({
rules: {
ordernum2: {
required: true,
minlength: 12
},
messages: {
ordernum2: {
required: "Please a enter post code",
minlength: "Must be at least 12 digits"
}},
var url = "mypage.php";
var params = "id_order="+$j("#ordernum1").val();
$j.ajax({
type: 'POST',
url: url,
dataType: 'html',
data: params, 
cache: false,
beforeSend: function() {
$j('#workflow-column-3').html('<div style="background-position:center; background-image:url(../img/css/contact/spinner40.gif); background-repeat:no-repeat; padding: 25px 50px 50px 50px; height:100px"></div>');
},
complete: function() {
return false;
},
success: function(data) {
$j('#serial-required').hide(),
$j('#workflow-column-3').show(),
$j('#workflow-column-3').html(data);
}
});
};
});
});
Sparky
  • 98,165
  • 25
  • 199
  • 285
ZeePee
  • 7
  • 5
  • If you get in the habit or properly indenting your code, you would have no problem spotting misplaced brackets. The very exercise of indenting the code above would have led you straight to finding the answer on your own. – Sparky Feb 01 '12 at 16:56

1 Answers1

2

Your rules object is missing it's closing bracket.

You have this:

rules: {
ordernum2: {
required: true,
minlength: 12
}

It should be this:

rules: {
  ordernum2: {
    required: true,
    minlength: 12
  }
}
Ryley
  • 21,046
  • 2
  • 67
  • 81