为空判断

服务器端的为空判断:ruby

class String
	def blank?
		self.nil? || self.strip.empty?
	end
end


网页前端的为空判断:js
function Check()
	{
		sel = document.yform.manual_action_title_select.value.replace(/\s/gi,"");
		input = document.yform.manual_action_title_input.value.replace(/\s/gi,"");
		if( sel == "" && input == "" ) {alert("value required!");return false;}
		
		return true;
	}

你可能感兴趣的:(java,Ruby)