<!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>
<meta http-equiv="Content-Type" content="text/html; charset=GBK">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<script src="js/checkForm.js"></script>
<script Charset="GBK" Type="Text/JavaScript" Language="JavaScript" SRC="js/selectcity_common.js"></script>
<script LANGUAGE="JavaScript">
//增加国家说明:
//1、不能增加日本;
//2、每增加一个国家,就会同时增加一个相应的selectcity_[国家序列号].js文件,
//如:增加一个法国,Country[4]="France";增加的相应文件为:selectcity_4.js
//
var Country=new Array;
Country[0]="Select";
Country[1]="USA";
Country[2]="中国";
var selectValue = "选择";
</script>
<script language="javascript">
function checkForm(theForm)
{
if(!checkEmpty(theForm.companyName,"请输入公司名称"))return false;
if(!checkLengthNotLow(theForm.companyName,2,"公司名称最少为2个字符"))return false;
if(!checkLengthNotUper(theForm.companyName,100,"公司名称最多为100个字符"))return false;
if(!checkEmpty(theForm.homepage,"请输入公司网址"))return false;
if(!checkLengthNotUper(theForm.homepage,100,"公司网址最多为100个字符"))return false;
if(!checkEmpty(theForm.phone1,"请输入电话号码"))return false;
if(!onlyThisMsg(theForm.phone1,"1234567890()-","电话号码应该是数字、()、-,不允许出现汉字等其他字符!"))return false;
if(!checkLengthNotUper(theForm.phone1,20,"电话长度不能超过20"))return false;
if(!checkEmpty(theForm.contacter1,"请输入联系人"))return false;
if(!checkLengthNotUper(theForm.contacter1,20,"联系人长度不能超过20"))return false;
if(!checkEmpty(theForm.operatorEmail,"请输入邮件地址"))return false;
if(!isEmail(theForm.operatorEmail,"邮件格式不对"))return false;
if(!checkEmpty(theForm.reoperatorEmail,"请输入确认邮箱"))return false;
if(!checkPassword(theForm.operatorEmail,theForm.reoperatorEmail,"您输入的邮箱不匹配,请重新输入"))return false;
if(theForm.province.options[0].selected==true)
{
alert("请选择省");
return false;
}
if(theForm.industry.options[0].selected==true)
{
alert("请选择行业类型");
return false;
}
if(!checkEmpty(theForm.operatorLoginName,"请输入客服登录ID"))return false;
if(!onlyThisMsg(theForm.operatorLoginName,"1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_","您的客服ID应该是数字、字母、下划线,不允许出现汉字等其他字符!"))return false;
if(!onlyThisMsgFirst(theForm.operatorLoginName,"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_","您的客服ID只能以字母或下划线开头!"))return false;
if(!checkLengthNotUper(theForm.operatorLoginName,20,"客服ID长度不能超过20个字符"))return false;
if(!checkEmpty(theForm.password,"请输入密码"))return false;
if(!checkLengthNotLow(theForm.password,6,"密码最少为6个字符"))return false;
if(!checkLengthNotUper(theForm.password,20,"密码最多为20个字符"))return false;
if(!checkEmpty(theForm.repassword,"请输入确认密码"))return false;
if(!checkPassword(theForm.password,theForm.repassword,"您输入的密码不匹配,请在密码输入框中重新输入密码"))return false;
if(!checkEmpty(theForm.textImage,"请输入验证码")) return false;
}
</script>
<style>
<!--
.span1{
font-weight:bold;font-size:13px; color:#000000; line-height:30px;
}
.table1
{
border: 1px solid #ccc;
background-color: #FFFFFF;
width: 100%;
}
.table1 td
{
padding-left: 10px;
height: 24px;
}
input
{
width: 100%;
}
-->
</style>
</head>
<body>
<form method="POST" action="trialRegisterAction.jsp" name="reg" onsubmit="return checkForm(this);">
<table cellpadding="0px" cellspacing="0px" border="0" class="table1">
<tr>
<td class="border3">
所在国家:<font color="red">*</font>
</td>
<td class="border4">
<select name="country"
onChange="provinceMenu(document.reg.country.selectedIndex,document.reg.province,document.reg.city,document.reg)">
<option selected>
选择
</option>
</select>
<script language="javascript">CountryOptionMenu(document.reg.country);</script>
</td>
</tr>
<tr>
<td class="border3">
所在省:<font color="red">*</font>
</td>
<td class="border4">
<select name="province"
onChange="javascript:selectcity(this,document.reg.city)">
<option selected>
选择
</option>
</select>
</td>
</tr>
<tr>
<td class="border3">
所在城市:
</td>
<td class="border4">
<select name="city">
<option selected value="">
选择
</option>
</select>
</td>
</tr>
</table>
</form>
</body>
</html>
javascript实现国家省份和城市三级互联
2星 需积分: 10 40 浏览量
2009-07-17
23:25:17
上传
评论 3
收藏 20KB RAR 举报
张梅甫
- 粉丝: 12
- 资源: 3