I have this multi-step form which I would like to validate (to make sure video file with correct format is specified and all the required field are filled up). I want to use jquery.validate plugin to achieve this.
The problem is that the "Upload" button was working fine before I added in this validation code. I believe something is wrong with my code which causes the "Upload" button to stop working. I have included a fiddle here: http://jsfiddle.net/NZr4n/
I believe this is the part which causes the error. Anyone could help?
$('#msform').validate({
rules: {
videoFile: {
required: true,
extension:'mov|mp4|mpeg|wmv'
}
videoTitle: {
required: true,
}
videoDescription: {
required: true,
}
},
messages: {
videoFile: "Please specify a file",
videoTitle: "Title is required"
videoDescription: "Description is required"
}
});
if ((!$('#msform').valid()) {
return false;
}