$(document).ready(function() {
	// validate signupform on keyup and submit
	var validator = $("#frmGeneral").validate({
		rules: {
			name: "required",
			project: "required",
			comment: "required",
			upload: "required",
			code: "required"
		},
		messages: {
			name: "Enter your name",
			project: "Enter your project name",
			comment: "Enter a comment",
			upload: "Select a file",
			code: "Enter security code"
		},
		// the errorPlacement has to take the table layout into account
		errorPlacement: function(error, element) {
				error.appendTo( element.parent().next() );
		},
		// specifying a submitHandler prevents the default submit, good for the demo
		submitHandler: function() {
			doWork();
		},
		// set this class to error-labels to indicate valid fields
		success: function(label) {

		}
	});

});
