??xml version="1.0" encoding="utf-8" standalone="yes"?>
<input type="button" name="SubmitPrevious" class="btnSet" value="预览" onClick="btPrint('7','printId,pageInfoId');">
<input type="button" name="SubmitPrevious" class="btnSet" value="讄" onClick="btPrint('8','printId,pageInfoId');">
<input type="button" name="btnSet" class="btnSet" value="导到Excel" onClick="saveToExcel('dataTable','人口职业构成人员名单');">
<input type="button" name="SubmitPrevious" class="btnSet" value="关闭" onClick="window.close();">
</div>
<body topmargin="0" leftmargin="0" onLoad="loadWebBrowser();">
览器的安全U别调低
]]>
* File Name : familyinfo.js
* Description : This is the js file for familyinfo
* Copyright : Copyright (s) 2006
* Company : sfsafe.
* Author : chenpeng
*/
var newRow=new FamilyMember();
var MainProblemCount=-1;
var MainProblemIndex=-1;
var FamilyMemberIndex=-1;
//定义家庭成员c?br />function FamilyMember() {
this.familyno="";
this.name="";
this.pid="";
this.relationcode="";
this.sex="";
this.birthday="";
this.education="";
this.vocational="";
this.marriage="";
this.nflag="";
}
//在家庭成员查询结果中获取一行的?br />function getRowValue(tablename,index,nflag)
{
newRow.name=document.getElementById(tablename).rows[index].cells[0].innerText;
newRow.pid=document.getElementById(tablename).rows[index].cells[1].innerText;
newRow.relationcode=document.getElementById(tablename).rows[index].cells[2].innerText;
newRow.sex=document.getElementById(tablename).rows[index].cells[3].innerText;
newRow.birthday=document.getElementById(tablename).rows[index].cells[4].innerText;
newRow.education=document.getElementById(tablename).rows[index].cells[5].innerText;
newRow.vocational=document.getElementById(tablename).rows[index].cells[6].innerText;
newRow.marriage=document.getElementById(tablename).rows[index].cells[7].innerText;
newRow.nflag=nflag;
opener.insertNewMember('FamilyMemberTable',newRow);
}
//在家庭成员列表中d一?br />function insertRowToFamilyMember(tablename,FamilyMember) {
var lastRowIndex=document.getElementById(tablename).rows.length;
FamilyMemberIndex++;
var insertButton="<input type='button' name='Submit2324' value='详细' onClick=\"viewMemberInfo('"+cTrim(FamilyMember.name)+"','"+cTrim(FamilyMember.pid)+"','"+cTrim(FamilyMember.nflag)+"');\"/>";
insertButton=insertButton+" <input type='button' name='delFamilyMember' value='删除' onClick=\"deleteFamilyMemberRow('FamilyMemberTable',this.parentNode.parentNode.rowIndex);\"/>";
var hiddenPid="<input type='hidden' name='newFamilyMemberList["+FamilyMemberIndex+"].pid' value='"+cTrim(FamilyMember.pid)+"' />" ;
var hiddenName="<input type='hidden' name='newFamilyMemberList["+FamilyMemberIndex+"].name' value='"+cTrim(FamilyMember.name)+"' />" ;
var selectRelation="<select name='newFamilyMemberList["+FamilyMemberIndex+"].relationcode' id='FamilyMember"+FamilyMemberIndex+"'></select>";
var hiddenSex="<input type='hidden' name='newFamilyMemberList["+FamilyMemberIndex+"].sex' value='"+cTrim(FamilyMember.sex)+"' />" ;
var hiddenBirthday="<input type='hidden' name='newFamilyMemberList["+FamilyMemberIndex+"].birthday' value='"+cTrim(FamilyMember.birthday)+"' />" ;
var hiddenMarriage="<input type='hidden' name='newFamilyMemberList["+FamilyMemberIndex+"].marriage' value='"+cTrim(FamilyMember.marriage)+"' />" ;
var hiddenNflag="<input type='hidden' name='newFamilyMemberList["+FamilyMemberIndex+"].nflag' value='"+cTrim(FamilyMember.nflag)+"' />" ;
var row=document.getElementById(tablename).insertRow(lastRowIndex);
var cell0=row.insertCell(0);
var cell1=row.insertCell(1);
var cell2=row.insertCell(2);
var cell3=row.insertCell(3);
var cell4=row.insertCell(4);
var cell5=row.insertCell(5);
var cell6=row.insertCell(6);
var cell7=row.insertCell(7);
cell0.className='TableStyle_L';
cell1.className='TableStyle';
cell2.className='TableStyle';
cell3.className='TableStyle';
cell4.className='TableStyle';
cell5.className='TableStyle';
cell6.className='TableStyle';
cell7.className='TableStyle_R';
cell0.innerHTML=FamilyMember.name+hiddenName;
cell1.innerHTML=FamilyMember.pid+hiddenPid;
cell2.innerHTML=selectRelation;
cell3.innerHTML=FamilyMember.sex+hiddenSex;
cell4.innerHTML=FamilyMember.birthday+hiddenBirthday;
cell5.innerHTML=FamilyMember.marriage+hiddenMarriage;
cell6.innerHTML="";
cell7.innerHTML=insertButton+hiddenNflag;
var source = document.getElementById("relationcode");
var desc = document.getElementById("FamilyMember"+FamilyMemberIndex);
desc.options.length=source.options.length;
for (var i = 0; i < desc.options.length; i++) {
desc.options[i].value = source.options[i].value;
desc.options[i].text = source.options[i].text;
}
}
//删除指定表格中指定行
function deleteRow(tablename,index)
{
document.getElementById(tablename).deleteRow(index);
}
//隐藏指定表格中指定行
function hiddenRow(tablename,index)
{
document.getElementById(tablename).rows[index].style.display = "none";
}
function insertRowToMainProblem(tablename) {
var insertButton="<input type='button' name='Submit232' value='删除' onClick=\"deleteMainProblemRow('MainProblemTable',this.parentNode.parentNode.rowIndex);\"/>";
var lastRowIndex=document.getElementById(tablename).rows.length;
var row=document.getElementById(tablename).insertRow(lastRowIndex);
MainProblemCount=MainProblemCount+lastRowIndex;
MainProblemIndex=parseInt(MainProblemIndex)+1;
var cell0=row.insertCell(0);
var cell1=row.insertCell(1);
var cell2=row.insertCell(2);
var cell3=row.insertCell(3);
cell0.className='TableStyle_L';
cell1.className='TableStyle';
cell2.className='TableStyle';
cell3.className='TableStyle_R';
cell0.innerHTML="<input type='text' name='newMainProblemList["+MainProblemIndex+"].happendate' id='happendate"+MainProblemCount+"' Class='textInput' size='10' readonly='true'/>"+
"<img style='cursor:hand' onclick=\"calendar(this,document.getElementById('happendate"+MainProblemCount+"'),'yyyy-mm-dd');\" height=16 src='image/datetime.gif' alt='日期' width=16 border=0 >";
cell1.innerHTML="<input type='text' name='newMainProblemList["+MainProblemIndex+"].solvedate' id='solvedate"+MainProblemCount+"' Class='textInput' size='10' readonly='true'/>"+
"<img style='cursor:hand' onclick=\"calendar(this,document.getElementById('solvedate"+MainProblemCount+"'),'yyyy-mm-dd');\" height=16 src='image/datetime.gif' alt='日期' width=16 border=0 >";
cell2.innerHTML="<select name='newMainProblemList["+MainProblemIndex+"].problemname' id='familyMainProblem"+MainProblemCount+"'></select>";
cell3.innerHTML=insertButton;
var source = document.getElementById("MainProblem");
var desc = document.getElementById("familyMainProblem"+MainProblemCount);
desc.options.length=source.options.length;
for (var i = 0; i < desc.options.length; i++) {
desc.options[i].value = source.options[i].value;
desc.options[i].text = source.options[i].text;
}
}
function cTrim(sInputString)
{
return sInputString.replace(/^\s+|\s+$/g, "");
}
//以下部分为地址做?/p>
var countyInit = false;
var streetInit = false;
var villageInit = false;
var groupInit = false;
function setAddr() {
var param = document.forms[0].elements("city").value;
changeProvince(param);
}
function postProcessReadyStateChanged(httpRequest, param) {
if (httpRequest.readyState == RS_COMPLETE) {
if (param[0] == document.forms[0].elements("condition.city") && !countyInit) {
countyInit = true;
param = document.forms[0].elements("county").value;
changeCity(param);
}
if (param[0] == document.forms[0].elements("condition.county") && !streetInit) {
streetInit = true;
param = document.forms[0].elements("street").value;
changeCounty(param);
}
if (param[0] == document.forms[0].elements("condition.street") && !villageInit) {
villageInit = true;
param = document.forms[0].elements("village").value;
changeStreet(param);
}
if (param[0] == document.forms[0].elements("condition.village") && !groupInit) {
groupInit = true;
param = document.forms[0].elements("group").value;
changeVillage(param);
}
}
}
function changeProvince(param) {
var desc = new Array();
desc[0] = document.forms[0].elements("condition.city");
desc[1] = document.forms[0].elements("condition.county");
desc[2] = document.forms[0].elements("condition.street");
desc[3] = document.forms[0].elements("condition.village");
desc[4] = document.forms[0].elements("condition.addgroup");
var sqlId = "selectAddr";
var sqlParam = new Array();
var sqlVal = document.forms[0].elements("condition.province").value;
sqlVal= sqlVal == "" ? "AA" : sqlVal;
sqlParam[0] = new SqlParam("parentCode",sqlVal );
linkage(desc, sqlId, sqlParam,param);
}
function changeCity(param) {
var desc = new Array();
desc[0] = document.forms[0].elements("condition.county");
desc[1] = document.forms[0].elements("condition.street");
desc[2] = document.forms[0].elements("condition.village");
desc[3] = document.forms[0].elements("condition.addgroup");
var sqlId = "selectAddr";
var sqlParam = new Array();
var sqlVal = document.forms[0].elements("condition.city").value;
sqlVal= sqlVal == "" ? "AA" : sqlVal;
if(param =="undefined"){
sqlVal=document.forms[0].elements("city").value;
}
sqlParam[0] = new SqlParam("parentCode", sqlVal);
linkage(desc, sqlId, sqlParam,param);
}
function changeCounty(param) {
var desc = new Array();
desc[0] = document.forms[0].elements("condition.street");
desc[1] = document.forms[0].elements("condition.village");
desc[2] = document.forms[0].elements("condition.addgroup");
var sqlId = "selectAddr";
var sqlParam = new Array();
var sqlVal = document.forms[0].elements("condition.county").value;
sqlVal= sqlVal == "" ? "AA" : sqlVal;
if(param =="undefined"){
sqlVal=document.forms[0].elements("county").value;
}
sqlParam[0] = new SqlParam("parentCode",sqlVal );
linkage(desc, sqlId, sqlParam,param);
}
function changeStreet(param) {
var desc = new Array();
desc[0] = document.forms[0].elements("condition.village");
desc[1] = document.forms[0].elements("condition.addgroup");
var sqlId = "selectAddr";
var sqlParam = new Array();
var sqlVal = document.forms[0].elements("condition.street").value;
sqlVal= sqlVal == "" ? "AA" : sqlVal;
if(param =="undefined"){
sqlVal=document.forms[0].elements("street").value;
}
sqlParam[0] = new SqlParam("parentCode", sqlVal);
linkage(desc, sqlId, sqlParam,param);
}
function changeVillage(param) {
var desc = new Array();
desc[0] = document.forms[0].elements("condition.addgroup");
var sqlId = "selectAddr";
var sqlParam = new Array();
var sqlVal = document.forms[0].elements("condition.village").value;
sqlVal= sqlVal == "" ? "AA" : sqlVal;
if(param =="undefined"){
sqlVal=document.forms[0].elements("street").value;
}
sqlParam[0] = new SqlParam("parentCode", sqlVal);
linkage(desc, sqlId, sqlParam,param);
}
function getAddrCode(){
province = document.forms[0].elements("condition.province").value;
city = document.forms[0].elements("condition.city").value;
county = document.forms[0].elements['condition.county'].value;
street = document.forms[0].elements['condition.street'].value;
village = document.forms[0].elements['condition.village'].value;
group = document.forms[0].elements['condition.addgroup'].value;
if(group!=""){
document.forms[0].elements("condition.addrCode").value = group;
return;
}
if(village!=""){
document.forms[0].elements("condition.addrCode").value = village;
return;
}
if(street!=""){
document.forms[0].elements("condition.addrCode").value = street;
return;
}
if(county!=""){
document.forms[0].elements("condition.addrCode").value = county;
return;
}
if(city!=""){
document.forms[0].elements("condition.addrCode").value = city;
return;
}
if(province!=""){
document.forms[0].elements("condition.addrCode").value = "33";
return;
}else {
document.forms[0].elements("condition.addrCode").value = "";
return;
}
}
//JS for AJAX 应用于家庭成员的q出
HTTPRequest = function () {
var xmlhttp=null;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (_e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (_E) {
xmlhttp = false;
}
}
if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
try {
xmlhttp = new XMLHttpRequest();
} catch (e) {
xmlhttp = false;
} }
return xmlhttp;
}
function moveoutFamilyMemberAjax(url) {
var request_url = "/jxhealth/queryfamilymember.do?";
request_url=request_url+url;
var http = new HTTPRequest();
http.open("GET", request_url, true);
http.onreadystatechange = function (){ handleHttpResponse(http)};
http.send();
}
function handleHttpResponse(http) {
}
/************************************/
<%@ page pageEncoding="GBK" contentType="text/html; charset=GBK"%>
<%@ taglib prefix="bean" uri="/WEB-INF/struts-bean.tld"%>
<%@ taglib prefix="html" uri="/WEB-INF/struts-html.tld"%>
<%@ taglib prefix="logic" uri="/WEB-INF/struts-logic.tld"%>
<%@ taglib prefix="jxh" uri="/WEB-INF/jxhealth.tld"%>
<html>
<head>
<title>家庭档案-家庭成员d</title>
<meta http-equiv="Content-Type" content="text/html; charset=GBK" />
<link rel="stylesheet" href="<%=request.getContextPath()%>/image/style.css" type="text/css" />
<style type="text/css">
<!--
.TableStyle {
height:30;
text-align:center;
border-top-style:none;
border-bottom-style:none;
border-left-style:none;
border-right-color:#FFFFFF;
}
.TableStyle2 TR {
background-color:expression((this.sectionRowIndex%2==0)?"#DDEEFF":"#FFFFFF")
}
.TableStyle_L {
height:25;
text-align:center;
border-top-style:none;
border-bottom-style:none;
border-right-color:#FFFFFF;
}
.TableStyle_R {
height:25;
text-align:center;
border-top-style:none;
border-bottom-style:none;
border-left-style:none;
}
-->
</style>
<script src="<%=request.getContextPath()%>/familyinfo/familyinfo.js" type="text/javascript"></script>
<script src="<%=request.getContextPath()%>/js/linkage.js" type="text/javascript"></script>
<script language="javascript">
//查询家庭成员信息
function searchs()
{
document.forms[0].processCategory.value = "queryFamilyMember";
document.forms[0].submit();
}
function moveOutFamilyMember(familyno,pid,name)
{
document.forms[0].processCategory.value = "moveOutFamilyMember";
document.forms[0].elements("familymemberCondition.familyno").value = familyno;
document.forms[0].elements("familymemberCondition.moveoutpid").value = pid;
document.forms[0].elements("familymemberCondition.moveoutname").value = name;
event.srcElement.disabled='disabled';
document.forms[0].submit();
}
function addRowToMain(tablename,index,nflag)
{
getRowValue(tablename,index,nflag);
event.srcElement.disabled='disabled';
}
</script>
</head>
<body topmargin="0" leftmargin="0">
<html:form action="/queryfamilymember">
<html:hidden property="processCategory" />
<html:hidden property="familymemberCondition.familyno"/>
<html:hidden property="familymemberCondition.moveoutpid"/>
<html:hidden property="familymemberCondition.moveoutname"/>
<bean:define id="familyNoBean" name="FAMILYNO"></bean:define>
<table width="962" align="center" height="207" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="962" align="center" valign="top">
<table width="99%" height="5" border="0" cellspacing="0" cellpadding="0">
<tr>
<td></td>
</tr>
</table>
<table width="100%" height="206" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<table class="RightTop" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="l"></td>
<td class="m" align="center"><a style="color:#FFFFFF; text-decoration:none">家庭成员查询</a></td>
<td class="r"></td>
</tr>
</table>
<table class="RightTOPT" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="l"><img src="<%=request.getContextPath()%>/image/Right_MM_L.gif" width="7" height="25"></td>
<td class="m"> </td>
<td class="r"></td>
</tr>
</table>
<table class="RightMiddle" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="l"></td>
<td height="100" align="center" valign="top" class="m">
<table width="915" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="msgFont" align="left" valign="bottom">
<html:messages id="msgs" message="true">
<LI><bean:write name="msgs" /></LI>
</html:messages>
</td>
</tr>
</table>
<table width="915" border="1" align="center" cellpadding="2" cellspacing="0" bordercolor="#31558c">
<tr>
<th width="907" colspan="9" ><table width="100%" align=center border="0" cellpadding="0" cellspacing="0" style=" border-bottom: hidden 0 PX solid ">
<tr>
<td width="120" height="30" align="center" style="color:#507dc2">姓名Q?</td>
<td width="197" align="left">
<html:text name="FamilyMemberForm" property="familymemberCondition.name" size="18" maxlength="18" style="width:140px; height:15px" styleClass="textInput" errorStyle="background-color:red" />
</td>
<td width="205" align="center" style="color:#507dc2">w䆾证号码:</td>
<td width="205" align="center">
<html:text name="FamilyMemberForm" property="familymemberCondition.pid" size="18" maxlength="18" style="width:140px; height:15px" styleClass="textInput" errorStyle="background-color:red" />
</td>
<td width="180" align="center">
<input type="button" name="submitbtn" value="查询" class="btnSet" onClick="searchs();"/>
<input type="button" name="closebtn" value="关闭" class="btnSet" onClick="window.close();"/>
</td>
</tr>
<tr>
<td width="120" height="10" align="center" style="color:#507dc2"></td>
<td width="197" align="left"></td>
<td width="205" align="center" style="color:#507dc2"></td>
<td width="205" align="center"></td>
<td width="180" align="center"></td>
</tr>
<tr>
<td colspan="5">
<logic:greaterThan name="FamilyMemberForm" property="pageInfo.totalPage" value="0">
<table width="884" border="0" align="center" cellpadding="3" cellspacing="0" bordercolor="#31558c">
<tr>
<td width="170" height="30" align="left" style="color:#507dc2"><strong>家庭成员信息一览表</strong></td>
<td width="702" colspan="6" align="right" style="color:#507dc2"><span class="f14 alignright mt5">每页
<html:select property="pageInfo.pageSize">
<html:option value="10"> 10 </html:option>
<html:option value="30"> 30 </html:option>
<html:option value="50"> 50 </html:option>
<html:option value="100"> 100 </html:option>
</html:select>
条记?br /> 排序方式
<label>
<html:select property="sortKey">
<html:option value="name">姓名</html:option>
<html:option value="pid">w䆾证号</html:option>
</html:select>
<input type="button" name="SubmitShow" class="btnSet" value="再显C? onClick="searchs();"/>
</label>
</span></td>
</tr>
<tr>
<td height="30" align="left" style="color:#507dc2" colspan="9">
<table id="FamilyMemberList" width="873" border="1" align="center" cellpadding="3" cellspacing="0" class="TableStyle2">
<tr style="font-size:12px;background-color:#507dc2">
<th width="77" height="30" align="center" style="color:#FFFFFF; border-right-color: #A6BEFF;border-bottom-style:none">姓名</th>
<th width="106" align="center" style="color:#FFFFFF; border-right-color: #A6BEFF; border-bottom-style:none; border-left-style:none">w䆾证号</th>
<th width="108" align="center" style="color:#FFFFFF; border-right-color: #A6BEFF; border-bottom-style:none; border-left-style:none">家庭~号</th>
<th width="30" align="center" style="color:#FFFFFF; border-right-color: #A6BEFF; border-bottom-style:none; border-left-style:none">性别</th>
<th width="98" align="center" style="color:#FFFFFF; border-right-color: #A6BEFF; border-bottom-style:none; border-left-style:none">出生日期</th>
<th width="77" align="center" style="color:#FFFFFF; border-right-color: #A6BEFF; border-bottom-style:none; border-left-style:none">文化E度</th>
<th width="77" align="center" style="color:#FFFFFF; border-right-color: #A6BEFF; border-bottom-style:none; border-left-style:none">职业</th>
<th width="40" align="center" style="color:#FFFFFF; border-right-color: #A6BEFF; border-bottom-style:none; border-left-style:none">婚姻</th>
<th width="102" align="center" style="color:#FFFFFF;border-bottom-style:none; border-left-style:none"> </th>
</tr>
<logic:iterate id="element" name="FamilyMemberForm" property="familymemberList" indexId="index">
<tr>
<td height="25" align="center" class="TableStyle_L">
<bean:write name="element" property="name" />
</td>
<td height="25" align="center" class="TableStyle">
<bean:write name="element" property="pid" />
</td>
<td height="25" align="center" class="TableStyle">
<bean:write name="element" property="familyno" />
</td>
<td height="25" align="center" class="TableStyle">
<bean:write name="element" property="sex" />
</td>
<td height="25" align="center" class="TableStyle">
<bean:write name="element" property="birthday" />
</td>
<td height="25" align="center" class="TableStyle">
<bean:write name="element" property="education" />
</td>
<td height="25" align="center" class="TableStyle">
<bean:write name="element" property="vocational" />
</td>
<td height="25" align="center" class="TableStyle">
<bean:write name="element" property="marriage" />
</td>
<td height="25" align="center" class="TableStyle_R">
<logic:notEqual name="element" property="familyno" value="<%=(String)familyNoBean %>">
<logic:empty name="element" property="familyno">
<input type="button" name="Submit32224" value="d" onClick="addRowToMain('FamilyMemberList',this.parentNode.parentNode.rowIndex,'<bean:write name="element" property="nflag" />');"/>
</logic:empty>
<logic:notEmpty name="element" property="familyno">
<logic:notEqual name="element" property="mflag" value="1">
<input type="button" name="Submit32224" value="d" disabled="disabled"/>
</logic:notEqual>
<logic:equal name="element" property="mflag" value="1">
<input type="button" name="Submit32224" value="d" onClick="addRowToMain('FamilyMemberList',this.parentNode.parentNode.rowIndex,'<bean:write name="element" property="nflag" />');"/>
</logic:equal>
</logic:notEmpty>
<logic:empty name="element" property="familyno">
<input type="button" name="Submit32223" value="q出" disabled="disabled"/>
</logic:empty>
<logic:notEmpty name="element" property="familyno">
<logic:equal name="element" property="relationcode" value="01">
<input type="button" name="Submit32223" value="q出" onClick="javascript:alert('此h是户?不能q出');"/>
</logic:equal>
<logic:notEqual name="element" property="relationcode" value="01">
<logic:equal name="element" property="mflag" value="1">
<input type="button" name="Submit32223" value="q出" disabled="disabled"/>
</logic:equal>
<logic:notEqual name="element" property="mflag" value="1">
<input type="button" name="Submit32223" value="q出"
onClick="moveOutFamilyMember('<bean:write name="element" property="familyno" />','<bean:write name="element" property="pid" />','<bean:write name="element" property="name" />');"/>
</logic:notEqual>
</logic:notEqual>
</logic:notEmpty>
</logic:notEqual>
<logic:equal name="element" property="familyno" value="<%=(String)familyNoBean %>">
<logic:equal name="element" property="mflag" value="1">
<input type="button" name="Submit32224" value="d" onClick="addRowToMain('FamilyMemberList',this.parentNode.parentNode.rowIndex,'<bean:write name="element" property="nflag" />');"/>
</logic:equal>
<logic:notEqual name="element" property="mflag" value="1">
<input type="button" name="Submit32224" value="d" disabled="disabled"/>
</logic:notEqual>
<input type="button" name="Submit32223" value="q出" disabled="disabled"/>
</logic:equal>
</td>
</tr>
</logic:iterate>
</table>
<table align="center" width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="right" style="color:#31558c;font-size:12px" height="30">
<jxh:pageInfo formIndex="0" />
</td>
</tr>
</table>
</td>
</tr>
</table>
</logic:greaterThan>
</td>
</tr>
</table></th>
</tr>
</table>
</td>
<td class="r"></td>
</tr>
</table>
<table class="RightDOWN" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="l"></td>
<td class="m"><img src="<%=request.getContextPath()%>/image/Right_D_C.gif" width="3" height="6"></td>
<td class="r"></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</html:form>
</body>
</html>
<link rel="stylesheet" type="text/css" id="css" href="./css.css">
<script language="javascript" type="text/javascript" src="datepicker/WdatePicker.js"></script>
<link href="datepicker/default/datepicker.css" rel="stylesheet" type="text/css">
<SCRIPT language="JavaScript">
<!--
function addOneLine() {
var newTable=document.getElementById("LineTable");
var newRow = newTable.insertRow();
oneCell = newRow.insertCell(0);
oneCell.innerHTML = "<p><select name=\"begin1\"><option value=\"0\">0</option><option value=\"1\">1</option><option value=\"2\">2</option><option value=\"3\">3</option><option value=\"4\">4</option><option value=\"5\">5</option><option value=\"6\">6</option><option value=\"7\">7</option><option value=\"8\">8</option><option value=\"9\" selected=\"true\">9</option><option value=\"10\">10</option><option value=\"11\">11</option><option value=\"12\">12</option><option value=\"13\">13</option><option value=\"14\">14</option><option value=\"15\">15</option><option value=\"16\">16</option><option value=\"17\">17</option><option value=\"18\">18</option><option value=\"19\">19</option><option value=\"20\">20</option><option value=\"21\">21</option><option value=\"22\">22</option><option value=\"23\">23</option></select><select name=\"begin2\"><option value=\"0\">00</option><option value=\"30\">30</option></select>---<select name=\"end1\"><option value=\"0\">0</option><option value=\"1\">1</option><option value=\"2\">2</option><option value=\"3\">3</option><option value=\"4\">4</option><option value=\"5\">5</option><option value=\"6\">6</option><option value=\"7\">7</option><option value=\"8\">8</option><option value=\"9\">9</option><option value=\"10\">10</option><option value=\"11\">11</option><option value=\"12\">12</option><option value=\"13\">13</option><option value=\"14\">14</option><option value=\"15\">15</option><option value=\"16\">16</option><option value=\"17\" selected=\"true\">17</option><option value=\"18\">18</option><option value=\"19\">19</option><option value=\"20\">20</option><option value=\"21\">21</option><option value=\"22\">22</option><option value=\"23\">23</option></select><select name=\"end2\"><option value=\"0\">00</option><option value=\"30\" selected=\"true\">30</option></select></p>";
oneCell.className="datath"
oneCell = newRow.insertCell(1);
oneCell.innerHTML = "<select name=\"workType\"><option value=\"1\">开?lt;/option><option value=\"2\">学习</option><option value=\"3\">讨论</option></select>";
oneCell.className="datath"
oneCell = newRow.insertCell(2);
oneCell.innerHTML = "<input name=\"textfield\" type=\"text\" size=\"35\" />";
oneCell.className="datath"
oneCell = newRow.insertCell(3);
oneCell.innerHTML = "<input type=\"button\" name=\"btn13\" value=\"删除\" class=\"button\" onmouseover=\"this.className=\'button_hover\'\" onclick=\"delOneLine(this);\" onmouseout=\"this.className=\'button\'\" />";
oneCell.className="datath"
}
function delOneLine(obj) {
if ( confirm("认要删除吗Q?) ) {
var mytable1 = self.document.all.LineTable;
mytable1.deleteRow(obj.parentNode.parentNode.rowIndex);
}
return false;
}
//-->
</SCRIPT>
</head>
<body style="margin:5px!important;margin:3px;">
<div id="position">
默认面
</div>
<div class="pannel">
<div class="title">日报</div>
<div class="subtitle">
<form name="form1">
<div class="tabber" id="mytabber1" style="text-align:center; margin-bottom:5px;">
<div class="tabbertab" style="background-color:#2D73AC; width:98%">
<table width="100%" border="0" cellspacing="1" cellpadding="0" style="padding-left:2px;" id="LineTable">
<tr style="background-color:white;">
<th width="39%" class="datath">工作旉<input name="text2223" type="text" class="Wdate" onfocus="new WdatePicker(this)" value="2007-01-01"/></th>
<th class="datath" width="10%">工作cd</th>
<th class="datath" width="39%">工作内容</th>
<th class="datath">
<input type="button" name="btn12" value="添?? class="button" onclick="addOneLine();" onmouseover="this.className='button_hover'" onmouseout="this.className='button'" /></th>
</tr>
<tr style="background-color:white;">
<th class="datath" align="left"><p>
<select name="select">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9" selected="true">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
</select><select name="select2">
<option value="1">00</option>
<option value="2">30</option>
</select>---<select name="select3">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17" selected="true">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
</select><select name="select4">
<option value="1">00</option>
<option value="2" selected="true">30</option>
</select></p>
</th>
<th class="datath" align="left">
<select name="workType">
<option value="1">开?lt;/option>
<option value="2">学习</option>
<option value="3">讨论</option>
</select></th>
<th class="datath" align="left">
<input name="textfield" type="text" size="35" /></th>
<th class="datath" align="left">
<input type="button" name="btn13" value="删除" class="button" onmouseover="this.className='button_hover'" onclick="delOneLine(this);" onmouseout="this.className='button'" /></th>
</tr>
</table>
</div>
</div>
<div style="padding-top:5px; padding-bottom:10px; vertical-align: middle; text-align:center;">
<input type="button" name="btn122" value="?? class="button" onmouseover="this.className='button_hover'" onmouseout="this.className='button'" />
</div>
</form>
</div>
<div class="clearboth"></div>
</div>
<div class="pannel">
<div class="title">查询</div>
<div class="subtitle">
<form name="form1">
<div style="float:right; padding-right:10px; vertical-align: middle;">
<select name="s1">
<option selected="selected">日期范围</option>
<option>一?lt;/option>
<option>两周</option>
<option>一?lt;/option>
<option>一?lt;/option>
<option>半年</option>
<option>一q?lt;/option>
</select>
<input name="text222" type="text" class="Wdate" onfocus="new WdatePicker(this)" value="2007-01-01"/>
-
<input name="text2222" type="text" class="Wdate" onfocus="new WdatePicker(this)" value="2007-01-01"/>
<input type="button" name="btn1" value="查询" class="button" onMouseOver="this.className='button_hover'" onMouseOut="this.className='button'" />
</div>
</form>
</div>
<div style="text-align:center; margin-bottom:5px;">
<div style="background-color:#2D73AC; width:98%">
<table width="100%" border="0" cellspacing="1" cellpadding="0" style="padding-left:2px;">
<tr style="background-color:white;">
<th width="20%" class="datath">序号</th>
<th width="30%" class="datath">日期</th>
<th class="datath">日报内容</th>
</tr>
<tr style="background-color:white;">
<td>00000001</td>
<td>2007-02-02</td>
<td>软g开?lt;/td>
</tr>
<tr style="background-color:white;">
<td>00000001</td>
<td>2007-02-02</td>
<td>学习JAVA</td>
</tr>
<tr style="background-color:white;">
<td>00000001</td>
<td>2007-02-02</td>
<td> </td>
</tr>
<tr style="background-color:white;">
<td>00000001</td>
<td>2007-02-02</td>
<td valign="bottom"> </td>
</tr>
<tr style="background-color:white;">
<td>00000001</td>
<td>2007-02-02</td>
<td valign="bottom"> </td>
</tr>
<tr style="background-color:white;">
<td>00000001</td>
<td>2007-02-02</td>
<td valign="bottom"> </td>
</tr>
<tr style="background-color:white;">
<td>00000001</td>
<td>2007-02-02</td>
<td valign="bottom"> </td>
</tr>
<tr style="background-color:white;">
<td>00000001</td>
<td>2007-02-02</td>
<td valign="bottom"> </td>
</tr>
<tr style="background-color:white;">
<td>00000001</td>
<td>2007-02-02</td>
<td valign="bottom"> </td>
</tr>
<tr style="background-color:white;">
<td>00000001</td>
<td>2007-02-02</td>
<td valign="bottom"> </td>
</tr>
</table>
</div>
</div>
<div class="page">|< << 1 2 3 4 5 6 7 8 9 10 >> >|
</div>
<div class="clearboth"></div>
</div>
</body>
</html>
setTitle();
//全?取消
//checkAll(comId,flag)
// comId 代表控g的名U?br />// flag 调用Ҏ一?为全选状?为取消状?调用ҎcheckAll("checkbox1","1")
// 调用Ҏ二时 flag 没有用处
function checkAll(comId,flag)
{
var blnFlag=false;
var a=document.getElementsByName(comId);
var n=a.length;
if(flag=='1'||flag=='0'){
if(flag=='1'){
blnFlag=true;
}
if(n>0){
for(var i=0;i<n;i++){
a[i].checked=blnFlag;
}
}
}else{
//var b=document.getElementsByName(flag);
if(n>0){
for(var i=0;i<n;i++){
a[i].checked=window.event.srcElement.checked;
}
}
}
}
//加蝲IE打印lg
//loadWebBrowser();
//打印预览函数
// strType 操作cdQ?是打华ͼ7是打印预览,8是打印页面设|?br />// strIds 要隐藏或昄的页面ID字符Ԍ其ID之间?Q?分割
function btPrint(strType,strIds){
//Web.ExecWB(4,1) 保存|页
//wb.ExecWB(6,1) 打印
//wb.ExecWB(7,1) 打印预览
//wb.ExecWB(8,1) 打印面讄
//wb.ExecWB(10,1) 查看面属?br /> //wb.ExecWB(15,1) 好像是撤销Q有待确?br /> //wb.ExecWB(17,1) 全?br /> //wb.ExecWB(22,1) h
//wb.ExecWB(45,1) 关闭H体无提C?br />
//昄面元素
idDisplay("none",strIds)
wb.ExecWB(strType,1);
//昄面元素
idDisplay("block",strIds)
}
//ID隐藏昄
function idDisplay(strStyleType,strIds){
if(strIds!=""){
var strIdAarry=strIds.split(",");
for(var i=0;i<strIdAarry.length;i++){
var strId=document.all(strIdAarry[i]);
strId.style.display=strStyleType;
}
}
}
//加蝲IE打印lg
function loadWebBrowser(){
var wbId= '<OBJECT ID=\"wb\" name=\"wb\" WIDTH=0 HEIGHT=0 CLASSID=\"CLSID:8856F961-340A-11D0-A96B-00C04FD705A2\"></OBJECT>';
document.body.insertAdjacentHTML('beforeEnd',wbId);
}
//××××××××××U联地址框提C处理×××××××××××××?/p>
//定义 select 原?br />//var oldValue,oldText,
var oldSelectedIndex;
//select下拉框的onkeydown事gQ修改下拉框的?br />function catch_keydown(sel)
{
switch(event.keyCode)
{
case 13: //回R?br /> event.returnValue = false;
break;
case 27: //Esc?br /> //sel.options[sel.selectedIndex].text = oldText;
//sel.options[sel.selectedIndex].value = oldValue;
sel.selectedIndex = oldSelectedIndex;
event.returnValue = false;
break;
case 8: //I格?br /> var s = sel.options[sel.selectedIndex].text;
s = s.substr(0,s.length-1);
if (sel.options[sel.selectedIndex].value==sel.options[sel.selectedIndex].text)
{
sel.options[sel.selectedIndex].value=s;
sel.options[sel.selectedIndex].text=s;
}
event.returnValue = false;
break;
}
if (!event.returnValue && sel.onchange)
sel.onchange(sel)
}
//select下拉框的onkeypress事gQ修改下拉框的?br />function catch_press(sel){
if(sel.selectedIndex>=0){
var s = sel.options[sel.selectedIndex].text + String.fromCharCode(event.keyCode);
if (sel.options[sel.selectedIndex].value==sel.options[sel.selectedIndex].text)
{
sel.options[sel.selectedIndex].value=s;
sel.options[sel.selectedIndex].text=s;
}
event.returnValue = false;
if (!event.returnValue && sel.onchange)
sel.onchange(sel)
}
}
//select下拉框的onfocus事gQ保存下拉框原来的?br />function catch_focus(sel) {
// oldText = sel.options[sel.selectedIndex].text;
// oldValue = sel.options[sel.selectedIndex].value;
oldSelectedIndex = sel.selectedIndex;
}
//恢复select下拉列表当前选中的?br />function LoadSelect(obj,value)
{
for (var i=0; i< obj.options.length; i++)
if (obj.options[i].value == value)
{
obj.selectedIndex = i;
break;
}
}
function adjustDivPos(div) {
with(div) {
style.display = "";
style.left = document.body.scrollLeft+event.clientX + 16;
style.top = document.body.scrollTop +event.clientY;
}
//document.body.scrollIntoView=document.body.scrollTop +event.clientY;
}
//select 选择框鼠标上UL提示选择的内?br />function selMouseOver(obj)
{
state=!state;
var DivRef = document.getElementById('div_hint');
var IfrRef = document.getElementById('DivShim');
if(IfrRef==null){
IfrRef = document.createElement('iframe');
IfrRef.style.display = "none";
IfrRef.style.position = "absolute";
IfrRef.setAttribute('id','DivShim');
document.body.appendChild(IfrRef);
}
if(state)
{
with (DivRef)
{
innerText = obj.options[obj.selectedIndex].text;
if (innerText.length > 0)
{
innerText = " " + innerText + " ";
style.display = "block";
style.left = document.body.scrollLeft+event.clientX + 16;
style.top = document.body.scrollTop +event.clientY;
}
}
DivRef.style.display = "block";
IfrRef.style.width = DivRef.offsetWidth;
IfrRef.style.height = DivRef.offsetHeight;
IfrRef.style.top = DivRef.style.top;
IfrRef.style.left = DivRef.style.left;
IfrRef.style.zIndex = DivRef.style.zIndex - 1;
IfrRef.style.display = "block";
}
}
//select 选择框鼠标移开时消?br />function selMouseOut(obj)
{
document.getElementById('div_hint').style.display = "none";
document.getElementById('DivShim').style.display = "none";
}
//初始化页面BtnDiv
function initBtnDiv(div, btnNum) {
div.style.display = "none";
adjustDivWidth(div,btnNum);
}
//ҎDiv内的内容调整昄宽度
function adjustDivWidth(div, btnNum) {
var NoneDispBtnNum = 0;
var buttons = div.getElementsByTagName("input");
for (i=0;i<buttons.length;i++) {
if (buttons[i].style.display == "none" && buttons[i].type == "button") {
NoneDispBtnNum = NoneDispBtnNum + 1;
}
}
var divWidth = div.style.width;
var width = divWidth.substr(0, divWidth.length-2);
//div.style.width = width - (parseInt(div.style.width) - BTN_DIV_MARGIN_WIDTH * 2) / btnNum * NoneDispBtnNum;
div.style.width = (btnNum - NoneDispBtnNum) * DIV_BTN_WIDTH + BTN_DIV_MARGIN_WIDTH * 2;
div.style.height = DIV_BTN_HEIGHT;
}
//q回q龄DOPTION
function getOptions(strBari){
var strValue="";
var strLable="";
if(strBari==""){
document.write("<option selected value=''>----</option>");
}else{
document.write("<option value=''>----</option>");
}
if(strBari=='0-1'){
document.write("<option selected value='0-1'>0?</option>");
}else{
document.write("<option value='0-1'>0?</option>");
}
if(strBari=='1-5'){
document.write("<option selected value='1-5'>1?</option>");
}else{
document.write("<option value='1-5'>1?</option>");
}
for(var i=1;i<=16;i++){
strValue=i*5+"-"+(i+1)*5;
strLable=i*5+"?+(i+1)*5;
if(i==16){
if(strBari=="80"){
document.write("<option selected value='80'>80以上</option>");
}else{
document.write("<option value='80'>80以上</option>");
}
}else{
if(strBari==strValue){
document.write("<option selected value='"+strValue+"'>"+strLable+"</option>");
}else{
document.write("<option value='"+strValue+"'>"+strLable+"</option>");
}
}
}
}
//昄生成的层及IFROM
//strModle="" OR "1" 是数据查?br /> //strModle="2" 是报?br /> function Fun_showSearch(strModle){
var strType="1";
if(strModle=="undefined"||strModle==""){
}else{
strType=strModle;
}
// 生成DIV
var s=window.document.createElement("DIV");
s.id="divFrm";
s.name="divFrm";
s.style.position="absolute";
s.style.left=(window.screen.width-600)/2+"px" ;
s.style.top=(window.screen.height)/2+15+"px";
s.style.width="300px";
s.style.height="40px";
s.style.border="black 0px solid";
//s.style.backgroundColor="red";
s.style.zIndex=10000;
// 生成iframe
var f=document.createElement("IFRAME");
f.name="frmDiv";
f.id="frmDiv";
f.width=s.style.width;
f.height=s.style.height;
f.scrolling="no";
f.frameBorder=0;
f.style.zIndex=s.style.zIndex-1;
f.src="javascript:false;";
// 附加f到s
s.appendChild(f);
// 昄s
document.body.appendChild(s);
// 创徏?br /> var t=document.createElement("DIV");
t.name="divShowFind";
t.id="divShowFind";
t.style.visibility="visible";
t.style.position="absolute";
t.style.left=s.style.left;
t.style.top=s.style.top;
t.style.width=s.style.width;
t.style.height=s.style.height;
t.style.border="solid 1px #FF5706";
//t.style.backgroundColor="blue";
t.style.zIndex=s.style.zIndex+1;
var strMsgTxt="pȝ提示Q数据正在请求之中,L?;
if(strType=="1"){
strMsgTxt="pȝ提示Q数据正在查询之中,L?;
}else if(strType=="2"){
strMsgTxt="pȝ提示Q数据正在上传之中,L?;
}else if(strType=="3"){
strMsgTxt="pȝ提示Q数据正在生成之中,L?;
}else{
strMsgTxt="pȝ提示Q数据正在请求之中,L?;
}
// 定义要显C的内容
var tableTxt="<table width=\"100%\" height=\"100%\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#ffffff\">"
tableTxt=tableTxt+"<tr><td align=\"center\" style=\"color:red;font-size:9pt\">"
tableTxt=tableTxt+strMsgTxt+"<img src='/jxhealth/image/waiting.gif' onerror=\"if (!this.times){this.times=1;};if (this.times<=10){src='/jxhealth/image/waiting.gif';this.times++}else{}\">";
tableTxt=tableTxt+"</td>";
//tableTxt=tableTxt+"<td width=15 align=\"center\" style=\"color:red;font-size:9pt\"><font style='cursor:hand' onclick='closeDiv()'>×</font></td>";
tableTxt=tableTxt+"</tr></table>";
t.innerHTML =tableTxt;
// 昄?br /> document.body.appendChild(t);
// 循环按钮置Z可用
var a = document.all;
for(var i=0; i<a.length; i++){
if(a[i].type=="button"||a[i].type=="reset"){
a[i].disabled=true;
}
}
}
//关闭?br /> function closeDiv(){
var objDiv1=document.getElementById('divFrm');
objDiv1.removeNode(true);
var objDiv2=document.getElementById('divShowFind');
objDiv2.removeNode(true);
var a = document.all;
for(var i=0; i<a.length; i++){
if(a[i].type=="button"||a[i].type=="reset"){
a[i].disabled=false;
}
}
}
//按钮变灰
function buttonDisabled(){
var a = document.all;
for(var i=0; i<a.length; i++){
if(a[i].type=="button"||a[i].type=="reset"){
a[i].disabled=true;
}
}
}
//键盘回R事g转化为tab事g
//text中的Readonly不进入焦?br /> //radio中的checked=false不进入焦?br /> function movetoNext(){
if(event.keyCode==13){//当按回R的时?br /> try{
if(document.activeElement.type=="textarea"){//当运到是textarea时不跛_下一个组?br /> if(document.activeElement.readOnly==true){//只读的话p下去
event.keyCode=9;
}
return true;
}else{
if (event.srcElement.type == "button"){
event.keyCode=9;
if(event.srcElement.value == "查询" || event.srcElement.value == "保存" || event.srcElement.value == "下一? || event.srcElement.value == "d" ){//|| event.srcElement.value == "编?
event.srcElement.onclick();
}
}else{
var nextIndex=getItemIndex();
if (document.all.item(nextIndex).type == "text" || document.all.item(nextIndex).type == "textarea"){
if(document.all.item(nextIndex).readOnly==true){
getNextIndex(nextIndex);
}else{
event.keyCode=9;
}
//getNextItem();
}else{//下一个不是text
if(document.all.item(nextIndex).disabled==true){
getNextIndex(nextIndex);
}else{
if(document.all.item(nextIndex).type=="radio"){
//document.all.item(nextIndex).focus();
///*每一个radio都进入焦?br /> if(document.all.item(nextIndex).checked==true){
event.keyCode=9;
}else{
getNextIndex(nextIndex);
}
//*/
}else{
event.keyCode=9;
}
}
}
}
}
}catch(e){
alert("未知异常");
event.keyCode=9
}
return true;
}else{
return false;
}
}
function getItemIndex(){
var index;//当前的sourceIndex
var nextIndex;//下一个sourceIndex
index=window.event.srcElement.sourceIndex;
index+=1;
with (document.all){
var aTab = new Array(length);
for ( var i=index;i<length;i++) {
if(item(i).type=="text" || item(i).type=="textarea" || item(i).type=="checkbox" || item(i).type=="radio" || (item(i).type=="select" && item(i).disabled==false ) || ( item(i).type=="select-one" && item(i).disabled==false ) ){
nextIndex = item(i).sourceIndex;
break;
}
}
}
return nextIndex;
}
function getNextIndex(argindex){
var index;//当前的sourceIndex
var nextIndex;//下一个sourceIndex
index=document.all.item(argindex).sourceIndex;
index+=1;
with (document.all){
var aTab = new Array(length);
for (var i=index;i<length;i++) {
if(item(i).type=="text" || item(i).type=="textarea" || item(i).type=="checkbox" || item(i).type=="radio" || (item(i).type=="select" && item(i).disabled==false ) || ( item(i).type=="select-one" && item(i).disabled==false ) ){
nextIndex = item(i).sourceIndex;
break;
}
}
}
if (document.all.item(nextIndex).type == "text" || document.all.item(nextIndex).type == "textarea"){
if(document.all.item(nextIndex).readOnly==true){
getNextIndex(nextIndex);
}else{
document.all.item(nextIndex).focus();
}
}else{
if(document.all.item(nextIndex).type==undefined){
event.keyCode=9;
}
if(document.all.item(nextIndex).disabled==true){
getNextIndex(nextIndex);
}else{
if(document.all.item(nextIndex).type=="radio"){
if(document.all.item(nextIndex).checked==true){
document.all.item(nextIndex).focus();
}else{
getNextIndex(nextIndex);
}
}else{
document.all.item(nextIndex).focus();
}
}
}
return true;
}
//基础js
// =========================================================
// 目Q嘉兴市民健康信息系l?br />// 描述QAJAX控制模块脚本
// 路径Q?Archive: $
// 版本Q?Version: $ $Date: $
// =========================================================
// ---------------------------------------------------------
// hqA状?br />// ---------------------------------------------------------
// h未初始?br />RS_UNINITIALIZED = 0;
// h已经建立Q但仍未发?br />RS_NOT_SENT = 1;
// h已经发送,服务器尚未反?br />RS_SENT = 2;
// 服务器已l对hq行响应Q已q回了部分数?br />RS_IN_PROCESS = 3;
// h处理l束
RS_COMPLETE = 4;
// ---------------------------------------------------------
// HTTP状态码分类
// ---------------------------------------------------------
// 信息(1xx)
SC_PREFIX_INFO = 1;
// 客户端请求成?2xx)
SC_PREFIX_SUCCESS = 2;
// h转发Q需要后l指C?3xx)
SC_PREFIX_REDIRECT = 3;
// 客户端请求错?4xx)
SC_PREFIX_INCOMPLETE = 4;
// 服务器错?5xx)
SC_PREFIX_ERROR = 5;
// ---------------------------------------------------------
// HTTP状态码帔R
// ---------------------------------------------------------
// 信息(1xx)
SC_CONTINUE = 100;
SC_SWITCHING_PROTOCOLS = 101;
// 客户端请求成?2xx)
SC_OK = 200;
SC_CREATED = 201;
SC_ACCEPTED = 202;
SC_NON_AUTHORITATIVE_INFORMATION = 203;
SC_NO_CONTENT = 204;
SC_RESET_CONTENT = 205;
SC_PARTIAL_CONTENT = 206;
// h转发Q需要后l指C?3xx)
SC_MULTIPLE_CHOICES = 300;
SC_MOVED_PERMANENTLY = 301;
SC_MOVED_TEMPORARILY = 302;
SC_FOUND = 302;
SC_SEE_OTHER = 303;
SC_NOT_MODIFIED = 304;
SC_USE_PROXY = 305;
SC_TEMPORARY_REDIRECT = 307;
// 客户端请求错?4xx)
SC_BAD_REQUEST = 400;
SC_UNAUTHORIZED = 401;
SC_PAYMENT_REQUIRED = 402;
SC_FORBIDDEN = 403;
SC_NOT_FOUND = 404;
SC_METHOD_NOT_ALLOWED = 405;
SC_NOT_ACCEPTABLE = 406;
SC_PROXY_AUTHENTICATION_REQUIRED = 407;
SC_REQUEST_TIMEOUT = 408;
SC_CONFLICT = 409;
SC_GONE = 410;
SC_LENGTH_REQUIRED = 411;
SC_PRECONDITION_FAILED = 412;
SC_REQUEST_ENTITY_TOO_LARGE = 413;
SC_REQUEST_URI_TOO_LONG = 414;
SC_UNSUPPORTED_MEDIA_TYPE = 415;
SC_REQUESTED_RANGE_NOT_SATISFIABLE = 416;
SC_EXPECTATION_FAILED = 417;
// 服务器错?5xx)
SC_INTERNAL_SERVER_ERROR = 500;
SC_NOT_IMPLEMENTED = 501;
SC_BAD_GATEWAY = 502;
SC_SERVICE_UNAVAILABLE = 503;
SC_GATEWAY_TIMEOUT = 504;
SC_HTTP_VERSION_NOT_SUPPORTED = 505;
// ---------------------------------------------------------
// Ҏ客户端浏览器cdQ徏立一个新的XML HTTPh对象Qƈ讄回调Ҏ?br />//
// 参数:
// param 在回调方法中要用到的参数对象
// q回:
// XML HTTPh对象Q或者nullQ如果浏览器不支持的话)
// ---------------------------------------------------------
function createXMLHttpRequest(param) {
var httpRequest = null;
if (window.XMLHttpRequest) { // Mozilla, Safari, ...
httpRequest = createInMozilla();
} else if (window.ActiveXObject) { // IE
httpRequest = createInIE();
}
if (httpRequest == null) {
try {
// 览器不支持AJAX
ajaxUnsupported();
return;
} catch (e) {
throw new Error("Initialization fails!");
}
}
// 讄回调Ҏ
httpRequest.onreadystatechange = function() {
readyStateChanged(httpRequest, param);
};
return httpRequest;
}
// ---------------------------------------------------------
// 在Mozilla中徏立ƈq回一个新的XML HTTPh对象?br />//
// 参数: ?br />// q回:
// XML HTTPh对象
// ---------------------------------------------------------
function createInMozilla() {
var mozInstance = null;
mozInstance = new XMLHttpRequest();
if (mozInstance.overrideMimeType) {
mozInstance.overrideMimeType("text/xml");
}
return mozInstance;
}
// ---------------------------------------------------------
// 在IE中徏立ƈq回一个新的XML HTTPh对象?br />//
// 参数: ?br />// q回:
// XML HTTPh对象
// ---------------------------------------------------------
function createInIE() {
var name = ["Msxml3.XMLHTTP", "Msxml2.XMLHTTP", "Microsoft.XMLHTTP"];
for (var i = 0; i < name.length; i++) {
try {
return new ActiveXObject(name[i]);
} catch (e) {
}
}
}
// ---------------------------------------------------------
// XML HTTPh对象的事件处理流E控制方法?br />// 该方法会在请求对象的qA状态发生变更的时候被自动调用?br />// 程控制中所调用的方法如非必,可以不定义,qƈ不会影响其他Ҏ的调用?br />//
// 参数:
// httpRequest XML HTTPh对象
// param 在回调方法中要用到的参数对象
// q回: ?br />// ---------------------------------------------------------
function readyStateChanged(httpRequest, param) {
try {
// 具体事g处理Ҏ调用之前的共通前期处?br /> preProcessReadyStateChanged(httpRequest, param);
} catch (e) {
}
try {
// Ҏ不同的状态,分别调用不同的处理方?br /> switch (httpRequest.readyState) {
case RS_UNINITIALIZED:
// h未初始?br /> readyStateUninitialized(httpRequest, param);
break;
case RS_NOT_SENT:
// h已经建立Q但仍未发?br /> readyStateNotSent(httpRequest, param);
break;
case RS_SENT:
// h已经发送,服务器尚未反?br /> readyStateSent(httpRequest, param);
break;
case RS_IN_PROCESS:
// 服务器已l对hq行响应Q已q回了部分数?br /> readyStateInProcess(httpRequest, param);
break;
case RS_COMPLETE:
// h处理l束
readyStateComplete(httpRequest, param);
break;
}
} catch (e) {
}
try {
// 具体事g处理Ҏ调用之后的共通后期处?br /> postProcessReadyStateChanged(httpRequest, param);
} catch (e) {
}
}
//ajax
/*--------------------------------------------------|
| dTree 2.05 | www.destroydrop.com/javascript/tree/ |
|---------------------------------------------------|
| Copyright (c) 2002-2003 Geir Landr? |
| |
| This script can be used freely as long as all |
| copyright messages are intact. |
| |
| Updated: 17.04.2003 |
|--------------------------------------------------*/
// Node object
function Node(id, pid, name, url, title, target, icon, iconOpen, open) {
this.id = id;
this.pid = pid;
this.name = name;
this.url = url;
this.title = title;
this.target = target;
this.icon = icon;
this.iconOpen = iconOpen;
this._io = open || false;
this._is = false;
this._ls = false;
this._hc = false;
this._ai = 0;
this._p;
};
// Tree object
function dTree(objName) {
this.config = {
target : null,
folderLinks : false,
useSelection : false,
useCookies : false,
useLines : false,
useIcons : false,
useStatusText : true,
closeSameLevel : true,
inOrder : false
}
this.icon = {
root : 'js/img/base.gif',
folder : 'js/img/folder.gif',
folderOpen : 'js/img/folderopen.gif',
node : 'js/img/page.gif',
empty : 'js/img/empty.gif',
line : 'js/img/line.gif',
join : 'js/img/join.gif',
joinBottom : 'js/img/joinbottom.gif',
plus : 'js/img/plus.gif',
plusBottom : 'js/img/plusbottom.gif',
minus : 'js/img/minus.gif',
minusBottom : 'js/img/minusbottom.gif',
nlPlus : 'js/img/nolines_plus.gif',
nlMinus : 'js/img/nolines_minus.gif'
};
this.obj = objName;
this.aNodes = [];
this.aIndent = [];
this.root = new Node(-1);
this.selectedNode = null;
this.selectedFound = false;
this.completed = false;
};
// Adds a new node to the node array
dTree.prototype.add = function(id, pid, name, url, title, target, icon, iconOpen, open) {
this.aNodes[this.aNodes.length] = new Node(id, pid, name, url, title, target, icon, iconOpen, open);
};
// Open/close all nodes
dTree.prototype.openAll = function() {
this.oAll(true);
};
dTree.prototype.closeAll = function() {
this.oAll(false);
};
// Outputs the tree to the page
dTree.prototype.toString = function() {
var str = '<div class="dtree">\n';
if (document.getElementById) {
if (this.config.useCookies) this.selectedNode = this.getSelected();
str += this.addNode(this.root);
} else str += 'Browser not supported.';
str += '</div>';
if (!this.selectedFound) this.selectedNode = null;
this.completed = true;
return str;
};
// Creates the tree structure
dTree.prototype.addNode = function(pNode) {
var str = '';
var n=0;
if (this.config.inOrder) n = pNode._ai;
for (n; n<this.aNodes.length; n++) {
if (this.aNodes[n].pid == pNode.id) {
var cn = this.aNodes[n];
cn._p = pNode;
cn._ai = n;
this.setCS(cn);
if (!cn.target && this.config.target) cn.target = this.config.target;
if (cn._hc && !cn._io && this.config.useCookies) cn._io = this.isOpen(cn.id);
if (!this.config.folderLinks && cn._hc) cn.url = null;
if (this.config.useSelection && cn.id == this.selectedNode && !this.selectedFound) {
cn._is = true;
this.selectedNode = n;
this.selectedFound = true;
}
str += this.node(cn, n);
if (cn._ls) break;
}
}
return str;
};
// Creates the node icon, url and text
dTree.prototype.node = function(node, nodeId) {
var str = '<div class="dTreeNode">' + this.indent(node, nodeId);
if (this.config.useIcons) {
if (!node.icon) node.icon = (this.root.id == node.pid) ? this.icon.root : ((node._hc) ? this.icon.folder : this.icon.node);
if (!node.iconOpen) node.iconOpen = (node._hc) ? this.icon.folderOpen : this.icon.node;
if (this.root.id == node.pid) {
node.icon = this.icon.root;
node.iconOpen = this.icon.root;
}
str += '<img id="i' + this.obj + nodeId + '" src="' + ((node._io) ? node.iconOpen : node.icon) + '" alt="" />';
}
if (node.url) {
str += '<a id="s' + this.obj + nodeId + '" class="' + ((this.config.useSelection) ? ((node._is ? 'nodeSel' : 'node')) : 'node') + '" href= "javascript:submitForm(\'menu'+node.id+'\''+',\''+node.url+'\')"';
if (node.title) str += ' title="' + node.title + '"';
if (node.target) str += ' target="' + node.target + '"';
if (this.config.useStatusText) str += ' onmouseover="window.status=\'\';return true;" onmouseout="window.status=\'\';return true;" ';
if (this.config.useSelection && ((node._hc && this.config.folderLinks) || !node._hc))
str += ' onclick="javascript: ' + this.obj + '.s(' + nodeId + ');"';
str += '>';
}
else if ((!this.config.folderLinks || !node.url) && node._hc && node.pid != this.root.id)
str += '<a href="javascript: ' + this.obj + '.o(' + nodeId + ');" class="node">';
str += node.name;
if (node.url || ((!this.config.folderLinks || !node.url) && node._hc)) str += '</a>';
str += '</div>';
if (node._hc) {
str += '<div id="d' + this.obj + nodeId + '" class="clip" style="display:' + ((this.root.id == node.pid || node._io) ? 'block' : 'none') + ';">';
str += this.addNode(node);
str += '</div>';
}
this.aIndent.pop();
return str;
};
// Adds the empty and line icons
dTree.prototype.indent = function(node, nodeId) {
var str = '';
if (this.root.id != node.pid) {
for (var n=0; n<this.aIndent.length; n++)
str += '<img src="' + ( (this.aIndent[n] == 1 && this.config.useLines) ? this.icon.line : this.icon.empty ) + '" alt="" />';
(node._ls) ? this.aIndent.push(0) : this.aIndent.push(1);
if (node._hc) {
str += '<a href="javascript: ' + this.obj + '.o(' + nodeId + ');"><img id="j' + this.obj + nodeId + '" src="';
if (!this.config.useLines) str += (node._io) ? this.icon.nlMinus : this.icon.nlPlus;
else str += ( (node._io) ? ((node._ls && this.config.useLines) ? this.icon.minusBottom : this.icon.minus) : ((node._ls && this.config.useLines) ? this.icon.plusBottom : this.icon.plus ) );
str += '" alt="" /></a>';
} else str += '<img src="' + ( (this.config.useLines) ? ((node._ls) ? this.icon.joinBottom : this.icon.join ) : this.icon.empty) + '" alt="" />';
}
return str;
};
// Checks if a node has any children and if it is the last sibling
dTree.prototype.setCS = function(node) {
var lastId;
for (var n=0; n<this.aNodes.length; n++) {
if (this.aNodes[n].pid == node.id) node._hc = true;
if (this.aNodes[n].pid == node.pid) lastId = this.aNodes[n].id;
}
if (lastId==node.id) node._ls = true;
};
// Returns the selected node
dTree.prototype.getSelected = function() {
var sn = this.getCookie('cs' + this.obj);
return (sn) ? sn : null;
};
// Highlights the selected node
dTree.prototype.s = function(id) {
if (!this.config.useSelection) return;
var cn = this.aNodes[id];
if (cn._hc && !this.config.folderLinks) return;
if (this.selectedNode != id) {
if (this.selectedNode || this.selectedNode==0) {
eOld = document.getElementById("s" + this.obj + this.selectedNode);
eOld.className = "node";
}
eNew = document.getElementById("s" + this.obj + id);
eNew.className = "nodeSel";
this.selectedNode = id;
if (this.config.useCookies) this.setCookie('cs' + this.obj, cn.id);
}
};
// Toggle Open or close
dTree.prototype.o = function(id) {
var cn = this.aNodes[id];
this.nodeStatus(!cn._io, id, cn._ls);
cn._io = !cn._io;
if (this.config.closeSameLevel) this.closeLevel(cn);
if (this.config.useCookies) this.updateCookie();
};
// Open or close all nodes
dTree.prototype.oAll = function(status) {
for (var n=0; n<this.aNodes.length; n++) {
if (this.aNodes[n]._hc && this.aNodes[n].pid != this.root.id) {
this.nodeStatus(status, n, this.aNodes[n]._ls)
this.aNodes[n]._io = status;
}
}
if (this.config.useCookies) this.updateCookie();
};
// Opens the tree to a specific node
dTree.prototype.openTo = function(nId, bSelect, bFirst) {
if (!bFirst) {
for (var n=0; n<this.aNodes.length; n++) {
if (this.aNodes[n].id == nId) {
nId=n;
break;
}
}
}
var cn=this.aNodes[nId];
if (cn.pid==this.root.id || !cn._p) return;
cn._io = true;
cn._is = bSelect;
if (this.completed && cn._hc) this.nodeStatus(true, cn._ai, cn._ls);
if (this.completed && bSelect) this.s(cn._ai);
else if (bSelect) this._sn=cn._ai;
this.openTo(cn._p._ai, false, true);
};
// Closes all nodes on the same level as certain node
dTree.prototype.closeLevel = function(node) {
for (var n=0; n<this.aNodes.length; n++) {
if (this.aNodes[n].pid == node.pid && this.aNodes[n].id != node.id && this.aNodes[n]._hc) {
this.nodeStatus(false, n, this.aNodes[n]._ls);
this.aNodes[n]._io = false;
this.closeAllChildren(this.aNodes[n]);
}
}
}
// Closes all children of a node
dTree.prototype.closeAllChildren = function(node) {
for (var n=0; n<this.aNodes.length; n++) {
if (this.aNodes[n].pid == node.id && this.aNodes[n]._hc) {
if (this.aNodes[n]._io) this.nodeStatus(false, n, this.aNodes[n]._ls);
this.aNodes[n]._io = false;
this.closeAllChildren(this.aNodes[n]);
}
}
}
// Change the status of a node(open or closed)
dTree.prototype.nodeStatus = function(status, id, bottom) {
eDiv = document.getElementById('d' + this.obj + id);
eJoin = document.getElementById('j' + this.obj + id);
if (this.config.useIcons) {
eIcon = document.getElementById('i' + this.obj + id);
eIcon.src = (status) ? this.aNodes[id].iconOpen : this.aNodes[id].icon;
}
eJoin.src = (this.config.useLines)?
((status)?((bottom)?this.icon.minusBottom:this.icon.minus):((bottom)?this.icon.plusBottom:this.icon.plus)):
((status)?this.icon.nlMinus:this.icon.nlPlus);
eDiv.style.display = (status) ? 'block': 'none';
};
// [Cookie] Clears a cookie
dTree.prototype.clearCookie = function() {
var now = new Date();
var yesterday = new Date(now.getTime() - 1000 * 60 * 60 * 24);
this.setCookie('co'+this.obj, 'cookieValue', yesterday);
this.setCookie('cs'+this.obj, 'cookieValue', yesterday);
};
// [Cookie] Sets value in a cookie
dTree.prototype.setCookie = function(cookieName, cookieValue, expires, path, domain, secure) {
document.cookie =
escape(cookieName) + '=' + escape(cookieValue)
+ (expires ? '; expires=' + expires.toGMTString() : '')
+ (path ? '; path=' + path : '')
+ (domain ? '; domain=' + domain : '')
+ (secure ? '; secure' : '');
};
// [Cookie] Gets a value from a cookie
dTree.prototype.getCookie = function(cookieName) {
var cookieValue = '';
var posName = document.cookie.indexOf(escape(cookieName) + '=');
if (posName != -1) {
var posValue = posName + (escape(cookieName) + '=').length;
var endPos = document.cookie.indexOf(';', posValue);
if (endPos != -1) cookieValue = unescape(document.cookie.substring(posValue, endPos));
else cookieValue = unescape(document.cookie.substring(posValue));
}
return (cookieValue);
};
// [Cookie] Returns ids of open nodes as a string
dTree.prototype.updateCookie = function() {
var str = '';
for (var n=0; n<this.aNodes.length; n++) {
if (this.aNodes[n]._io && this.aNodes[n].pid != this.root.id) {
if (str) str += '.';
str += this.aNodes[n].id;
}
}
this.setCookie('co' + this.obj, str);
};
// [Cookie] Checks if a node id is in a cookie
dTree.prototype.isOpen = function(id) {
var aOpen = this.getCookie('co' + this.obj).split('.');
for (var n=0; n<aOpen.length; n++)
if (aOpen[n] == id) return true;
return false;
};
// If Push and pop is not implemented by the browser
if (!Array.prototype.push) {
Array.prototype.push = function array_push() {
for(var i=0;i<arguments.length;i++)
this[this.length]=arguments[i];
return this.length;
}
};
if (!Array.prototype.pop) {
Array.prototype.pop = function array_pop() {
lastElement = this[this.length-1];
this.length = Math.max(this.length-1,0);
return lastElement;
}
};
/**//*------------------------------------------------------------
dateDlg(inputid,initDate,startYear,endYear) 弹出旉H口
compareDate(end,s) 与当前时间比?br /> compareTwoDate(startDate,endDate,s) 比较两个旉
isNumber(text,name) 判断全是数字(true)
isChar(text,addtemp,name,include) 判断W合要求字符
isEmail(text) 判断是电子邮?br /> isPid(text) 判断是n份证?br /> isNull(text,name) 判断为空则提C?true)
getLength(text) 获取长度
lengthEquals(text,name,num) 定长度(true)
lengthless(text,name,num) 长度不少?true)
lengthmore(text,name,num) 长度不大?true)
checkPassword(text,text1) 验两ơ输入密码是否一?true)
------------------------------------------------------------
//checkData()攑֜jsp面
<script language="JavaScript" src="check.js"></script>
<script language="JavaScript">
function checkData()
{
if(isNull(form1.name,'帐号')){}
else if(lengthEquals(form1.name,"帐号",8)){}
else if (getLength(form1.name)>13){}
else{
form1.submit();
}
}
</script>
------------------------------------------------------------*/
/**//*------------------------------------------------------------
弹出旉选择控?br /> inputidQ-文本框name
initDateQ-初始日期QؓI时是当前时?br /> startYearQ-日期范围的开始日?br /> endYearQ-日期范围的结束日?br /> 使用例子onClick="dateDlg(end,'1999-11-12','1980','2010')"
------------------------------------------------------------*/
function dateDlg(inputid,initDate,startYear,endYear)
{
var pattern = /^(19|20)([0-9]){2}$/;
flag=pattern.test(startYear);
if(!flag)startYear=1900;
flag=pattern.test(endYear);
if(!flag)endYear=2050;
if(inputid.value==null||inputid.value=='')
{
if(initDate==null||initDate=='')
{
currentDate = new Date();
}
else{
currentDate = initDate;
}
}
else{
currentDate = inputid.value;
}
var arguments = new Array(startYear,endYear,0,0,0)
var pattern = /^(19|20)([0-9]){2}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])$/;
flag=pattern.test(currentDate);
if(flag)
{
iYear=currentDate.substring(0,4);
iMonth=currentDate.substring(5,7);
iDay=currentDate.substring(8,10);
arguments = new Array(startYear,endYear,iYear,iMonth,iDay)
}
showx = event.screenX - event.offsetX + 18;
showy = event.screenY - event.offsetY - 210;
var features =
'dialogWidth:' + 192 + 'px;' +
'dialogHeight:' + 210 + 'px;' +
'dialogLeft:' + showx + 'px;' +
'dialogTop:' + showy + 'px;' +
'directories:no; localtion:no; menubar:no; status=no; toolbar=no;scrollbars:yes;Resizeable=no';
retval = window.showModalDialog("../js/calendar.htm", arguments , features );
var calctrl = eval(inputid)
if( retval != null ){
calctrl.value = retval;
}else{
//alert("canceled");
}
}
/**//*------------------------------------------------------------
Trim()d右空?br /> ------------------------------------------------------------*/
String.prototype.Trim = function()
{
return this.replace(/(^\s*)|(\s*$)/g, "");
}
String.prototype.LTrim = function()
{
return this.replace(/(^\s*)/g, "");
}
String.prototype.Rtrim = function()
{
return this.replace(/(\s*$)/g, "");
}
/**//*------------------------------------------------------------
判断密码是否有单引号
------------------------------------------------------------*/
function isNotYinhao(s)
{
var yin;
var temp="'";
for(yin=0; yin < s.length; yin++ )
{
var ch = s.charAt(yin);
if(temp.indexOf(ch)>=0)
{
return true;
}
}
return false;
}
/**//*------------------------------------------------------------
定义变量
------------------------------------------------------------*/
var i,j;
/**//*------------------------------------------------------------
和当前日期比较,如果当前日期大于输入日期则提C?br /> end----输入日期
s----提示信息
使用例子onClick="compareDate(end,'选择日期不能在今天之?')"
------------------------------------------------------------*/
function compareDate(end,s){
var a=new Date();
var b=end.value;
if(((Number(a.getYear())-Number(b.substring(0,4)))*356+
(Number(a.getMonth())-Number(b.substring(5,7))+1)*31+
(Number(a.getDate())-Number(b.substring(8,10))))>0)
{
alert(s);
end.focus();
}
}
/**//*------------------------------------------------------------
两个旉q行比较Q当开始日期大于结束日期则提示
startDate----开始日?br /> endDate------l束日期
使用例子onClick="compareTwoDate(startDate,endDate,'开始日期不能大于结束日?')"
------------------------------------------------------------*/
function compareTwoDate(startDate,endDate,s)
{
var a=startDate.value;
var b=endDate.value;
if(((Number(a.substring(0,4))-Number(b.substring(0,4)))*356+
(Number(a.substring(5,7))-Number(b.substring(5,7)))*31+
(Number(a.substring(8,10))-Number(b.substring(8,10))))>0)
{
alert(s);
startDate.focus();
}
}
/**//*------------------------------------------------------------
判断是否为数字类型,如不是数字类型则提示
text-------输入文本
name-------提示的名?br /> 使用例子onBlur="compareTwoDate(this,'电话L')"
------------------------------------------------------------*/
function isNumber(text,name)
{
var temp="0123456789";
for(j=0; j<text.value.length; j++ )
{
var ch = text.value.Trim().charAt(j);
if(temp.indexOf(ch)==-1)
{
alert(name+"应ؓ数字cd!");
text.focus();
return true;
}
}
}
/**//*------------------------------------------------------------
判断两次密码输入是否一?br /> text-------新密?br /> name-------再次输入新密?br /> 使用例子checkPassword(form1.newpass,form1.newpass1)
------------------------------------------------------------*/
function checkPassword(text,text1)
{
var newpass=text.value.Trim();
var newpass1=text1.value.Trim();
if(newpass!=newpass1){
alert("两次输入新密码不一?");
text.focus();
return true;
}
}
/**//*------------------------------------------------------------
判断是否包含非法字符Q如含非法字W则提示
text-------输入文本
addtemp----除英文和数字外还可包含的字符
name-------提示的名?br /> include----提示中不允许包含的字W?br /> 使用例子onBlur="compareTwoDate(this,'@_','邮g','%*$')"
------------------------------------------------------------*/
function isChar(text,addtemp,name,include)
{
var temp="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"+addtemp;
for(j=0; j<text.value.length; j++ )
{
var ch = text.value.Trim().charAt(j);
if(temp.indexOf(ch)==-1)
{
alert(name+"中不允许包含'"+include+"'{字W?");
text.focus();
break;
}
}
}
/**//*------------------------------------------------------------
判断输入的是否ؓ电子邮gQ如含非法字W则提示
text-------输入的电子邮?br /> 使用例子onBlur="isEmail(this)"
------------------------------------------------------------*/
function isEmail(text)
{
var email=text.value.Trim();
var m=email.indexOf("@");
var n=email.indexOf(".");
if(email!="")
{
if(m<1||m>email.length-3)
{
alert("误入正的电子邮g格式!");
text.focus();
return true;
}
else if(n<m+2||n>email.length-2)
{
alert("误入正的电子邮g格式!");
text.focus();
return true;
}
}
}
/**//*------------------------------------------------------------
判断输入文本是否n份证LQ如Z正确则提C?br /> text-------输入的n份证L
使用例子onBlur="isPid(this)"
------------------------------------------------------------*/
function isPid(text)
{
var pid=text.value.Trim();
var temp="0123456789";
var temp1="0123456789xX";
if(pid!=""){
if(pid.length==15)
{
for(j=0; j<15; j++ )
{
var ch = pid.charAt(j);
if(temp.indexOf(ch)==-1)
{
alert("误入正的w䆾证号?");
text.focus();
break;
}
}
}
else if(pid.length==18)
{
for(j=0; j<pid.length-1; j++ )
{
var ch = pid.charAt(j);
if(temp.indexOf(ch)==-1)
{
alert("误入正的w䆾证号?");
text.focus();
break;
}
}
var ch1 = pid.charAt(pid.length-1);
if(temp1.indexOf(ch1)==-1)
{
alert("误入正的w䆾证号?");
text.focus();
}
}
else{
alert("w䆾证号码的应ؓ15位或18?");
text.focus();
}}
}
/**//*------------------------------------------------------------
判断输入文本是否为空Q如为空则提C?br /> text-------输入文本
使用例子onBlur="isNull(this,'姓名')"
------------------------------------------------------------*/
function isNull(text,name)
{
if(text.value.Trim()==null||text.value.Trim()=="")
{
alert(name+"不能为空!");
text.focus();
return true;
}
}
/**//*------------------------------------------------------------
获取文本框长度,中文作ؓ两个字符处理
text-------输入文本
使用例子getLength(form1.name)
------------------------------------------------------------*/
function getLength(text)
{
var temp="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
temp=temp+" temp=temp+"·~!◎#K%……※×(Q——+Q=÷【】『』;‘:“,。、《?";
var len = text.value.Trim().length;
for(j=0;j<text.value.Trim().length;j++)
{
var ch= text.value.Trim().charAt(j);
if(temp.indexOf(ch)==-1){
len++;
}
}
return len;
}
/*------------------------------------------------------------
lengthEquals(text,name,num) 相等长度
lengthless(text,name,num) 长度不少?br /> lengthmore(text,name,num) 长度不大?br /> 获取文本框长度,中文作ؓ两个字符处理
text-------输入文本
使用例子getLength(form1.name,'姓名',8)
------------------------------------------------------------*/
function lengthEquals(text,name,num)
{
if(getLength(text)!=num)
{
alert("误?+num+"?+name+"!")
text.focus();
return true;
}
}
function lengthless(text,name,num)
{
if(getLength(text)<num)
{
alert(name+"不能于"+num+"?")
text.focus();
return true;
}
}
function lengthmore(text,name,num)
{
if(getLength(text)>num)
{
alert(name+"不能大于"+num+"?")
text.focus();
return true;
}
}
/*------------------------------------------------------------
判断bodyText输入文本是否为空Q如为空则提C?br /> bodyText-------输入文本
使用例子onBlur="isNullBody('姓名')"
------------------------------------------------------------*/
function isNullBody(name)
{
var bodyText = frames["Dvbbs_Composition"].document.body.innerText;
if(bodyText.length==0) {
frames["Dvbbs_Composition"].focus();
alert(name+"不能为空!");
return true;
}
}
/*------------------------------------------------------------
获取文本框长度,中文作ؓ两个字符处理
bodyText-------输入文本
使用例子isLengthBody(form1.name)
------------------------------------------------------------*/
function isLengthBody(text,name)
{
if (text.value.length > 600) {
frames["Dvbbs_Composition"].focus();
alert(name+"不能过600!");
return true;
}
}
/*------------------------------------------------------------
查是否含有?“号
有,则返回true
? 则返回false
------------------------------------------------------------*/
function isTheChar(text,name)
{
var re= /'/g;
var arr = text.match(re);
if (arr == null)
return false;
else
return true;
}
var MobileStr = document.submitform85.MobilePhone.value;
var i,j,strTemp;
strTemp="0123456789";
if(MobileStr.substring(0,2)!="13"&&MobileStr.substring(0,1)!="0")
{
alert ('错误Q不是有效的手机/灵?固定电话LQ?);
return false;
}
if (MobileStr.length<11)
{
alert ('错误Q手?灵?固定电话L长度不能于11Q?);
return false;
}
for (i=0;i<11;i++)
{
j=strTemp.indexOf(MobileStr.substring(i, i+1));
if (j==-1)
{
alert ('错误Q手机号码不能含有字W!');
return false;
}
}
return true;
}