﻿jQuery(function($){
	$('form').each(function(){
		var $thisForm = $(this);
		var $notempty = $(this).find('.notempty');
		$(this).find(':submit').click(function(){
			$notempty.each(function(){
				if($(this).val()==''&&!$(this).next('.warn')[0]){
					$(this).after('<span style="color:red;padding-left:1em" class="warn">这个选项您必须填写才能提交。</span>');
				}
			});
			if($thisForm.find('.warn')[0]){
				return false;
			}
		});
		$notempty.focus(function(){
			$(this).next('span').remove();
		});
	});
});
