📄 com.js
字号:
//<meta http-equiv="Content-Type" content="text/html; charset=gb2312" >
// JavaScript Document
//*******reg.jsp***************//
function reg_save(){
if(document.form1.username.value==""||document.form1.password.value==""||document.form1.repassword.value==""||document.form1.name.value==""){
alert("代*号内容必须填写");
return false;
}
if(document.form1.password.value!=document.form1.repassword.value){
alert("密码与密码确认不符");
return false;
}
if(document.form1.username.value.indexOf("'")!=-1||document.form1.password.value.indexOf("'")!=-1||
document.form1.repassword.value.indexOf("'")!=-1||document.form1.email.value.indexOf("'")!=-1||
document.form1.name.value.indexOf("'")!=-1||document.form1.age.value.indexOf("'")!=-1||document.form1.homepage.value.indexOf("'")!=-1){
alert("禁止填写非法字符");
return false;
}
if(document.form1.username.value.indexOf("<")!=-1||document.form1.password.value.indexOf("<")!=-1||
document.form1.repassword.value.indexOf("<")!=-1||document.form1.email.value.indexOf("<")!=-1||
document.form1.name.value.indexOf("<")!=-1||document.form1.age.value.indexOf("<")!=-1||document.form1.homepage.value.indexOf("<")!=-1){
alert("禁止填写非法字符");
return false;
}
if(document.form1.username.value.indexOf(">")!=-1||document.form1.password.value.indexOf(">")!=-1||
document.form1.repassword.value.indexOf(">")!=-1||document.form1.email.value.indexOf(">")!=-1||
document.form1.name.value.indexOf(">")!=-1||document.form1.age.value.indexOf(">")!=-1||document.form1.homepage.value.indexOf(">")!=-1){
alert("禁止填写非法字符");
return false;
}
if(document.form1.username.value.indexOf("\"")!=-1||document.form1.password.value.indexOf("\"")!=-1||
document.form1.repassword.value.indexOf("\"")!=-1||document.form1.email.value.indexOf("\"")!=-1||
document.form1.name.value.indexOf("\"")!=-1||document.form1.age.value.indexOf("\"")!=-1||document.form1.homepage.value.indexOf("\"")!=-1){
alert("禁止填写非法字符");
return false;
}
if(document.form1.age.value!=""){
if(isNaN(document.form1.age.value)){
alert("年龄请输入数字");
return false;
}
}
if(document.form1.email.value!=""){
if(document.form1.email.value.indexOf("@")==-1||document.form1.email.value.indexOf(".")==-1){
alert("您的Email地址错误");
return false;
}
}
return true;
}
//********login.jsp******************//
function login(){
if(document.form1.username.value!=""&&document.form1.password.value!=""){
return true;
}else{
return false;
}
}
function reg(){
if(document.form1.button){
document.location='reg.jsp';
}
}
//********mas.jsp******************//
function mas(){
if(document.form1.topic.value==""){
alert("请输入留言主题");
return false;
}
if(document.form1.email.value==""){
alert("请输入Email");
return false;
}
if(document.form1.email.value.indexOf("@")==-1||document.form1.email.value.indexOf(".")==-1){
alert("请输入正确Email");
return false;
}
return true;
}
//********masview.jsp******************//
function openmas(){
window.open("mas.jsp","","toolbar=no,memubar=no,scrollbrs=no,width=450,height=290,left=300,top=180,center=yes");
}
function delmas(){
window.open("delmas.jsp","","width=0,heihth=0");
}
//********errorpage.jsp******************//
//********bbs.jsp******************//
function addbbs(){
if(document.form1.title.value==""){
alert("请输入主题");
return false;
}
return true;
}
//*******email.jsp***************//
function email(){
if(document.form1.jname.value==""||document.form1.jname.value.indexOf("@")==-1||document.form1.jname.value.indexOf(".")==-1){
alert("请输入寄信人正确Email");
return false;
}
if(document.form1.sname.value==""||document.form1.sname.value.indexOf("@")==-1||document.form1.sname.value.indexOf(".")==-1){
alert("请输入收信人正确Email");
return false;
}
if(document.form1.title.value==""){
alert("请输入主题");
return false;
}
return true;
}
//*******send.jsp***************//
function send(){
if(document.form1.said.value==""){
alert("发送信息不能为空");
return false;
}
if(document.form1.said.value>100){
alert("信息过多");
return false;
}
if(document.form1.lname.value==""){
alert("请选择聊天对象");
return false;
}
document.form1.submit();
document.form1.said.focus();
document.form1.said.value="";
}
function Myenter(){
if(event.keyCode==13){
send();
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -