$(document).ready(function() {
	
	$("form").submit(function() {
		error = 0;
		$(this).children(".required").each(function() {
			if($(this).val() == "") {
				error = 1;
				$(this).css("border-color", "red");
			}
			else {
				$(this).css("border-color", "inherit");
			}
		});
		if(error == 1) {
			alert("Musisz wypełnić wszystkie wymagane pola!");
			return false;
		}
		else {
			return true;
		}
	});

});
