$.validator.setDefaults({
	//submitHandler: function() { alert("submitted!"); }
});

$().ready(function() {
	
	
	// validate signup form on keyup and submit
	$("#order").validate({
		//debug: true,
			//errorElement: "em",


		rules: {
			Quantity: "required",
			Colour: "required",
			Spectacle_Usage: "required",
			Transition: "required",
			Tinted: "required",
			Prescription_Method: "required",
			PD: "number",
			Axis_Right: {
        required: true,
        range: [-180, 180]
      },
      Axis_Left: {
        required: true,
        range: [-180, 180]
      },
			Agreement: "required",
			Confirmation: "required"
		},
		messages: {
			Quantity: "<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Please enter a quantity",
			Colour: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Please choose an option <br/>",
			Spectacle_Usage: "<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Please select an option ",
			Transition: "<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Please select  an option ",
			Tinted: "<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Please select an option ",
			Prescription_Method: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Please select an option ",
			PD: "<br/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Please enter a number",
			Agreement: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Please agree to the terms and conditions <br/>",
			Confirmation: "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Please confirm there is no addition on your prescription <br/>"
		}
	});
	

});