Android下的web开发弹出框及表单提交控制

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<link href="ymPrompt.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="../js/active/jquery-1.5.js"></script>
		<script type="text/javascript" src="ymPrompt.js"></script>
	</head>
	<body>
		<div class="main">
alert改为ymPrompt插件,表单验证在onsubmit事件中,通过提交节点的可用性防止重复提交,因为服务器端做了集群还没来得及做公用session缓存所以token暂时失效
			<form action="" method="post" id="mf" onsubmit="return onSubmitForm()">
				发动机号<input type='text' id='eng'/>
				<input type='submit' id='sb'/>
			</form>
		</div>
				<script type="text/javascript">
var onSubmitForm = function() {

	var sb = $('#sb');
	sb.attr('disabled', 'disabled');

	var enginenum = $('#eng').val();
	var engEeg =/^[\d|\w]{8,13}$/;
	if (enginenum == '' || !engEeg.test(enginenum)) {
		ymPrompt.errorInfo("发动机号错误",null,null,"错误");
		sb.removeAttr('disabled');
		return false;
	}
	
	ymPrompt.confirmInfo({message:'已确认信息准确?', handler:handler});
	return false;
}

var handler = function(tp){
			if(tp=='ok'){
				onSubmitForm = function(){return true};
				$('#mf').submit();
			} else {
				$('#sb').removeAttr('disabled');
			}
		};

		</script>
	</body>
</html>