(function($) {

$.fn.validation = function() {		

    var error = 0;
		
	$('.required-field', this).each(function() {
		var input = $(':input', this).attr("value");
		if (input == "") {
			$('span.error-message', this).remove();
			$(this).append('<span class="error-message"><span class="error"></span></span>');
			$('span.error', this).html('入力必須項目です。Please fill in this mandatory field.');
			error++;
		} else {
			$('span.error-message', this).remove();
		}
	});
	
	if (error == 0) {
		return true;
	} else {
		return false;
	}
};

})(jQuery);


$(function() {
	$("#validationForm").submit(function () {
		return $(this).validation();
	});
});
