81,122
社区成员




<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>aaa</title>
<script language=javascript>
window.onload = historyOncemore;
window.onbeforeunload = fixHistory;
var city=[
["北京","天津","上海","重庆","香港","澳门"],
["石家庄","唐山","秦皇岛","邯郸","邢台","保定","张家口","承德","沧州","廊坊","衡水"],
["太原","大同","阳泉","长治","晋城","朔州","晋中","运城","忻州","临汾","吕梁"],
["呼和浩特","包头","乌海","赤峰","通辽","鄂尔多斯","呼伦贝尔","巴彦淖尔","乌兰察布","兴安","锡林郭勒","阿拉善"]
]
function getCity(t){
alert(document.getElementById("province").selectedIndex)
//获得省份下拉框的对象
var sltProvince=document.userupdateForm.province;
//获得城市下拉框的对象
var sltCity=document.userupdateForm.city;
//得到对应省份的城市数组
var provinceCity=city[sltProvince.selectedIndex - 1];
//清空城市下拉框,仅留提示选项
// sltCity.length=1;
//将城市数组中的值填充到城市下拉框中
for(var i=0;i<provinceCity.length;i++){
sltCity[i+1]=new Option(provinceCity[i],provinceCity[i]);
}
}
function getSelfCity(t){
alert(document.getElementById("city").selectedIndex)
}
function fixHistory() //记住历史
{
document.getElementById("theHistoryRecord").value=document.getElementById("thedetailtableDIV").innerHTML.replace(/\n/g,"");
document.getElementById("index1").value = document.getElementById("province").selectedIndex;
document.getElementById("index2").value = document.getElementById("city").selectedIndex;
}
function historyOncemore() //恢复历史
{
if (document.getElementById("theHistoryRecord").value!="")
{
document.getElementById("thedetailtableDIV").innerHTML=document.getElementById("theHistoryRecord").value;
document.getElementById("province").selectedIndex = document.getElementById("index1").value;
document.getElementById("city").selectedIndex = document.getElementById("index2").value;
}
}
function submitProcess()
{
document.userupdateForm.submit();
}
</script>
</head>
<body>
<form name="userupdateForm" action="hehee.html">
<input type="button" value="完成" class="bottom" onclick="submitProcess();">
<div width=100% id="thedetailtableDIV">
<select id="province" name="province" onChange="getCity(this)">
<option value="" >请选择所在省份</option>
<option value="直辖市">直辖市</option>
<option value="河北">河北</option>
<option value="山西">山西</option>
</select>
<select id="city" name="city" onChange="getSelfCity(this)">
<option value="">请选择所在城市</option>
</select></td></tr>
</div>
</form>
<input name="theHistoryRecord" id="theHistoryRecord" type=hidden value="">
<input name="index1" id="index1" type=hidden value="">
<input name="index2" id="index2" type=hidden value="">
</body>
</html>
<%@ page language="java" import="java.util.*" pageEncoding="gbk"%>
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-tiles" prefix="tiles" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>updateuser</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<!--
<link rel="stylesheet" type="text/css" href="styles.css">
-->
<script type="text/javascript">
window.onload = historyOncemore;
window.onbeforeunload = fixHistory;
//定义了城市的二维数组,里面的顺序跟省份的顺序是相同的。通过selectedIndex获得省份的下标值来得到相应的城市数组
var city=[
["北京","天津","上海","重庆","香港","澳门"],
["石家庄","唐山","秦皇岛","邯郸","邢台","保定","张家口","承德","沧州","廊坊","衡水"],
["太原","大同","阳泉","长治","晋城","朔州","晋中","运城","忻州","临汾","吕梁"],
["呼和浩特","包头","乌海","赤峰","通辽","鄂尔多斯","呼伦贝尔","巴彦淖尔","乌兰察布","兴安","锡林郭勒","阿拉善"]
];
function getCity(){
//获得省份下拉框的对象
var sltProvince=document.userupdateForm.province;
//获得城市下拉框的对象
var sltCity=document.userupdateForm.city;
//得到对应省份的城市数组
var provinceCity=city[sltProvince.selectedIndex - 1];
//清空城市下拉框,仅留提示选项
// sltCity.length=1;
//将城市数组中的值填充到城市下拉框中
for(var i=0;i<provinceCity.length;i++){
sltCity[i+1]=new Option(provinceCity[i],provinceCity[i]);
}
}
function fixHistory() //记住历史
{
document.all("theHistoryRecord").value=document.all("thedetailtableDIV").innerHTML.replace(/\n/g,"");
}
function historyOncemore() //恢复历史
{
if (document.all("theHistoryRecord").value!="")
{document.all("thedetailtableDIV").innerHTML=document.all("theHistoryRecord").value;
}
}
function selectallcheckbox(obj) //全选或全不选
{
var tureorfalse=obj.checked;
var theDetail=tbDetailUsed.rows;
for(var i=0;i<theDetail.length-1;i++)
{
theDetail[i].all("record_select").checked=tureorfalse;
}
}
function submitProcess()
{
document.userupdateForm.submit();
}
</script>
</head>
<body>
<table width="990" height="750">
<tr><logic:iterate id="user" name="userdata" scope="session">
<td width="200"><jsp:include page="/jsp/menu.jsp" flush="true"/></td>
<td align="center" valign="top"><table align="center">
<html:form action="/userupdate" method="post" onsubmit="return validateuserupdateForm(this)" focus="companyname">
<tr><td>用户名 <font color="red">*</font></td>
<td><html:text property="username" disabled="true" value="${user.udName}"/><FONT color="red"><html:errors property="username"/></FONT></td></tr>
<tr><td>请选择企业所在行业<font color="red">*</font></td>
<td><select name="business">
<option value="null" selected="selected">请选择</option>
<option value="医药卫生">医药卫生</option>
<option value="建筑建材">建筑建材</option>
<option value="冶金矿产">冶金矿产</option>
<option value="石油化工">石油化工</option>
</select><font color="red"><html:errors property="business"/></font></td>
</tr>
<tr><td>请选择企业所在城市<font color="red">*</font></td>
<td><div width=100% id=thedetailtableDIV><select name="province" onChange="getCity()">
<option value="null" selected="selected">请选择所在省份</option>
<option value="直辖市">直辖市</option>
<option value="河北">河北</option>
<option value="山西">山西</option>
<option value="内蒙古">内蒙古</option>
</select>
<select name="city">
<option selected="selected" value="null">请选择所在城市</option>
</select><font color="red"><html:errors property="city"/></font></td></tr></div>
<tr><td>请输入企业地址 </td>
<td><html:text property="companydress" value="${user.udCompdress}"/><font color="red"><html:errors property="companydress"/></font></td></tr>
<tr><td colspan="2" align="center">
<html:hidden property="status" value="update"/>
<html:hidden property="username" value="${user.udName}"/>
<html:submit property="update" value="提交更改" onclick="submitProcess();" />
<input name="theHistoryRecord" type=hidden value="">
</td></tr>
</html:form> </table>
</td></logic:iterate></tr>
</table>
<
<input name="theHistoryRecord" type=hidden value="">
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>aaa</title>
<script language=javascript>
window.onload = historyOncemore;
window.onbeforeunload = fixHistory;
var city=[
["北京","天津","上海","重庆","香港","澳门"],
["石家庄","唐山","秦皇岛","邯郸","邢台","保定","张家口","承德","沧州","廊坊","衡水"],
["太原","大同","阳泉","长治","晋城","朔州","晋中","运城","忻州","临汾","吕梁"],
["呼和浩特","包头","乌海","赤峰","通辽","鄂尔多斯","呼伦贝尔","巴彦淖尔","乌兰察布","兴安","锡林郭勒","阿拉善"]
]
function getCity(){
//获得省份下拉框的对象
var sltProvince=document.userupdateForm.province;
//获得城市下拉框的对象
var sltCity=document.userupdateForm.city;
//得到对应省份的城市数组
var provinceCity=city[sltProvince.selectedIndex - 1];
//清空城市下拉框,仅留提示选项
// sltCity.length=1;
//将城市数组中的值填充到城市下拉框中
for(var i=0;i<provinceCity.length;i++){
sltCity[i+1]=new Option(provinceCity[i],provinceCity[i]);
}
}
function fixHistory() //记住历史
{
document.all("theHistoryRecord").value=document.all("thedetailtableDIV").innerHTML.replace(/\n/g,"");
}
function historyOncemore() //恢复历史
{
if (document.all("theHistoryRecord").value!="")
{document.all("thedetailtableDIV").innerHTML=document.all("theHistoryRecord").value;
}
}
function selectallcheckbox(obj) //全选或全不选
{
var tureorfalse=obj.checked;
var theDetail=tbDetailUsed.rows;
for(var i=0;i<theDetail.length-1;i++)
{
theDetail[i].all("record_select").checked=tureorfalse;
}
}
function submitProcess()
{
document.userupdateForm.submit();
}
</script>
</head>
<body>
<form name="userupdateForm" action="about:结果页面">
<input type="button" value="完成" class="bottom" onclick="submitProcess();">
<div width=100% id=thedetailtableDIV>
<select name="province" onChange="getCity()">
<option value="null" selected="selected">请选择所在省份</option>
<option value="直辖市">直辖市</option>
<option value="河北">河北</option>
<option value="山西">山西</option>
</select>
<select name="city">
<option selected="selected" value="null">请选择所在城市</option>
</select><font color="red"><html:errors property="city"/></font></td></tr>
</div>
</form>
<input name="theHistoryRecord" type=hidden value="">
</body>
</html>
<script type="text/javascript">
//定义了城市的二维数组,里面的顺序跟省份的顺序是相同的。通过selectedIndex获得省份的下标值来得到相应的城市数组
var city=[
["北京","天津","上海","重庆","香港","澳门"],
["石家庄","唐山","秦皇岛","邯郸","邢台","保定","张家口","承德","沧州","廊坊","衡水"],
["太原","大同","阳泉","长治","晋城","朔州","晋中","运城","忻州","临汾","吕梁"],
["呼和浩特","包头","乌海","赤峰","通辽","鄂尔多斯","呼伦贝尔","巴彦淖尔","乌兰察布","兴安","锡林郭勒","阿拉善"]
]
function getCity(){
//获得省份下拉框的对象
var sltProvince=document.userupdateForm.province;
//获得城市下拉框的对象
var sltCity=document.userupdateForm.city;
//得到对应省份的城市数组
var provinceCity=city[sltProvince.selectedIndex - 1];
//清空城市下拉框,仅留提示选项
// sltCity.length=1;
//将城市数组中的值填充到城市下拉框中
for(var i=0;i<provinceCity.length;i++){
sltCity[i+1]=new Option(provinceCity[i],provinceCity[i]);
}
}
</script>
</head>
<table>
<form name="userupdateForm">
<tr><td>请选择企业所在城市<font color="red">*</font></td>
<td><select name="province" onChange="getCity()">
<option value="null" selected="selected">请选择所在省份</option>
<option value="直辖市">直辖市</option>
<option value="河北">河北</option>
<option value="山西">山西</option>
</select>
<select name="city">
<option selected="selected" value="null">请选择所在城市</option>
</select><font color="red"><html:errors property="city"/></font></td></tr>
</table>
</table>