From a6e4095dfb8e5c9eddf066ca6643608fabae57f6 Mon Sep 17 00:00:00 2001
From: whb <whb@yoho.cn>
Date: Mon, 11 Apr 2016 13:47:51 +0800
Subject: [PATCH] 在线登记

---
 res/js/yohood.js | 28 ++++++++++++++++++++--------
 1 file changed, 20 insertions(+), 8 deletions(-)

diff --git a/res/js/yohood.js b/res/js/yohood.js
index 6f663fc..0cac971 100644
--- a/res/js/yohood.js
+++ b/res/js/yohood.js
@@ -779,15 +779,27 @@ define('yohood', function(require, exports) {
 		$(".content-header a").bind("click", function(e)
 		{
 			var href = $(this).attr("href");
-			$(this).attr("href","javascript:void(0)");
-			if(window.confirm('切换后已填信息将被清空,是否切换?'))
+			var isNotEmpty = false;
+			//判断表单数据是否为空
+			$.each($("input[type=text]"), function(i,  obj) 
 			{
-				window.location.href = href;
-			}
-			else
-			{
-				$(this).attr("href", href);
-				return false;
+				if($.trim($(obj).val()) != '')
+				{
+					isNotEmpty = true;
+					return;
+				}
+			});
+			if(isNotEmpty) {
+				$(this).attr("href","javascript:void(0)");
+				if(window.confirm('切换后已填信息将被清空,是否切换?'))
+				{
+					window.location.href = href;
+				}
+				else
+				{
+					$(this).attr("href", href);
+					return false;
+				}
 			}
 		});
 		$(".apply-operate span").bind("click", function()
--
libgit2 0.24.0