등록 양식(소스 코드)

2262 단어
<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
	</head>
	<body>
		<form action="./index.php?c=Channel_Reg" id="opForm" method="get">
			<input type="hidden" name="e" value="Add" />
			 :
			<input type="text" name="userid" id="userid" class="reginput" />
			<br />
			 :
			<input type="password" name="pwd" id="pwd" class="reginput" />
			<br />

			 :
			<input type="password" name="repwd" id="repwd" class="reginput" />
			<br />
			<input type="submit" value=" " class="btn upload" />
			<input type="reset" value=" " />
		</form>
		<script type="text/javascript"
			src="http://images.pchome.net/product/js/zmf.js"></script>
		<script language="JavaScript">
	var validate = {
		isAccount : function(str) {
			var reg = /^[a-zA-Z0-9]{4,16}$/;
			return reg.test(str);

		}
	}
	var opBaseInfo = function() {
		var opForm = Pchome.$('opForm');
		var compUserid = Pchome.$('userid');
		var compPwd = Pchome.$('pwd');
		var compRePwd = Pchome.$('repwd');

		opForm.onsubmit = function() {
			if (compUserid.value.replace(/[ ]/g, "") == ''
					|| !validate.isAccount(compUserid.value)) {
				alert(' !!!');
				compUserid.focus();
				return false;
			}
			if (compPwd.value.replace(/[ ]/g, "") == '') {
				alert(' !');
				compPwd.focus();
				return false;
			}
			if (compRePwd.value.replace(/[ ]/g, "") == '') {
				alert(' !');
				compRePwd.focus();
				return false;
			}
			if (compPwd.value != compRePwd.value) {
				alert(' , !');
				compRePwd.focus();
				return false;
			}
		}
	}();
</script>
	</body>
</html>

좋은 웹페이지 즐겨찾기