一般用于弹出对话框(确定/否)
确定:就执行其嵌套的内容;否:则反之
<script language="javascript">
//验证时间格式 YYYY-MM-DD/YYYY,MM,DD
function isDate(date){
var regu = "^[0-9]{4}-([0-1]?)[0-9]{1}-([0-3]?)[0-9]{1}$";
var re = new RegExp(regu);
if (date.search(re) != -1)
return true;
else
return false;
}
function sureButton(){
if(!confirm('真的要删除吗?删除后将无法恢复!')){
return;
}
//验证时间格式 YYYY-MM-DD
var startDate=document.getElementById("startDate").value;
var endDate=document.getElementById("endDate").value;
if(!isDate(startDate)){
alert(startDate+"请输入正确的开始日期格式!如:(YYYY-MM-DD)2008-01-01");
return document.getElementById("startDate").focus();
}
if(!isDate(endDate)){
alert("请输入正确的结束日期格式!如:(YYYY-MM-DD)2008-01-01");
return document.getElementById("endDate").focus();
}
if(startDate==""){
alert("请输入开始日期");
return document.getElementById("startDate").focus();
}
if(endDate==""){
alert("请输入结束日期");
return document.getElementById("endDate").focus();
}
startDate=startDate.replace(new RegExp('-', 'g'),'/');
alert(startDate);
endDate=endDate.replace(new RegExp('-', 'g'),'/');
var startTime=new Date(startDate).getTime();
alert(new Date(startDate).getTime());
var endTime=new Date(endDate).getTime();
if((endTime-startTime)<0){
alert("结束日期必须大于开始日期");
return document.getElementById("endDate").focus();
}
}
</script>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta name="generator" content="Bluefish 1.0.7">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<style type="text/css">
table{color: #000000; font-family: 宋体; font-size: 12px; height:12 }
t1{color:#008000;align:center}
</style>
</head>
<body topmargin="0" leftmargin="0">
<div align="left">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="461" height="8" id="AutoNumber1" background="images/kabg.gif">
<tr>
<td colspan="3">
<table cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" height="17">
<tr>
<td width="19%" height="25" align="center" style="border:1px solid #000080;"><font color="#008000">开始日期</font></td>
<td width="31%" style="border:1px solid #000080;">
<input name="startDate" type="text" id="startDate" size="15"></td>
<td width="22%" align="center" style="border:1px solid #000080;"><font color="#008000">结束日期</font></td>
<td width="28%" style="border:1px solid #000080;">
<input name="endDate" type="text" id="endDate" size="15"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="28" align="center" style="border:1px solid #000080; " colspan="3">
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber3" height="17">
<tr>
<td width="14%" align="center" height="25">
<font color="#008000">当前状态</font></td>
<td width="18%" align="center" height="25">
<select size="1" name="display">
<option value="0">无效</option>
<option value="1">等待</option>
<option value="2" selected>显示中</option>
</select></td>
<td width="15%" align="center" height="25" style="border-left: 1px solid #000080; border-right-width: 1; border-top-width: 1; border-bottom-width: 1">
<font color="#008000">Logo行宽</font></td>
<td width="10%" align="center" height="25">
<select size="1" name="colValue">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
</select></td>
<td width="12%" align="center" style="border-left: 1px solid #000080; border-right-width: 1; border-top-width: 1; border-bottom-width: 1"><font color="#008000">显示顺序</font></td>
<td width="5%" >
<input name="displayOrder" type="text" id="displayOrder" size="3" value="1">
</td>
<td width="43%" align="center" height="25" style="border-left-style: solid; border-left-width: 1; border-right-width: 1; border-top-width: 1; border-bottom-width: 1">
<input onclick="cancelButton()" type="reset" value="关闭" name="B2" style="border-style: outset; border-width: 1; color:#0000FF">
<input onclick="sureButton()" type="submit" value="确定" name="B1" style="border-style: outset; border-width: 1; color:#0000FF"></td>
</tr>
</table>
</td>
</tr>
<tr>
<td height="20" colspan="3" align="center" style="border:1px solid #000080; ">
<marquee behavior="slide" style="color: #808080">::日期格式为年-月-日,直接填入图片和点击路径全名时应仔细查对是否正确::</marquee></td>
</tr>
</table>
</div>
</body>
</html>
分享到:
相关推荐
下面我们通过这两个小例子,来了解一下它的使用方法吧: 代码如下:<html><head><title>confrim 的使用方法</title>[removed]function clear1(){ if(confirm(“确定要清空数
最近在学习magik,这是我今天写的一个用户注册的例子,里面包括了,常用的...因为我每次都是使用load_file编译的,它都只是重新覆盖以前的方法,对于以前版本,而现在版本不存在的方法它还是能使用,所以出了点问题。
继承WebChromeClient类,在这个类的3个方法中,分别使用Android的内置控件重写了Js中对应的对话框,就是说对js中的对话框做处理了,就是重写了。 通过Android调用JS处理alert弹出框 、处理confirm弹出框、处理...
,包括confirm对话框和modal型图形界面的用法。 shili.rar ,包括了4个很好的例子: (1)具有多个坐标轴的GuI,主要学习控制哪一个坐标轴是绘图命令的对象和用编辑文本框读入输入的数。 (2)...
,包括confirm对话框和modal型图形界面的用法。 shili.rar ,包括了4个很好的例子: (1)具有多个坐标轴的GuI,主要学习控制哪一个坐标轴是绘图命令的对象和用编辑文本框读入输入的数。 (2)...
,包括confirm对话框和modal型图形界面的用法。 shili.rar ,包括了4个很好的例子: (1)具有多个坐标轴的GuI,主要学习控制哪一个坐标轴是绘图命令的对象和用编辑文本框读入输入的数。 (2)...
支持窗口拖动,Ajax动态加载数据,显示桌面时钟,显示桌面图标、开始菜单等,使用方法:创建一个窗口:AddWin(Aid,Atitle,Aurl,Aw,Ah,Atype,Abut) Aid -- 唯一ID,不要与其它窗口相同,可以是任意字母数字等 A...
用法 警报 $.ea.alert(message[,title[,icon]]) 例子: $.ea.alert("I'm new",'Warning'); 确认 $.ea.confirm(message[, title[, callback[, icon]]]) 例子: $.ea.confirm('Are your...
包含方法有: <br>messageBox:function(_width,_height,_title,_message) <br>alertBox:function(_title,_message) <br>confirmBox:function(_title,_message) <br>使用了一些Prototype.js的方法,...
1.本书附源代码共计381个,其运行环境如下: ...• 14.2.htm alert()方法与confirm()方法的使用 • 14.3.htm prompt()方法的使用 • 14.4.htm window.open()方法 • 14.5.htm ...
pod 'XPYKit' :git => ' https :/ / github . com / xiangxiaopenyou / XPYKit . git用法警报 [XPYAlertManager showAlertWithTitle:@"Alert" message:@"Alert" cancel:@"取消" confirm:@"确定" inController:self ...
方法与confirm()方法的使用 • 14.3.htm prompt()方法的使用 • 14.4.htm window.open()方法 • 14.5.htm 用链接和按钮实现窗口打开 • 14.6.htm 窗口的打开和关闭 • 14.7....
#Angularjs-Match-Directive 作者:安东尼·罗德里格斯。 用于验证两个字段是否相等的自定义匹配指令。... 将match指令属性插入要匹配的元素中,在我们的例子中是: confirmPassword match="pas
6.1.8 ext.domquery的使用方法 / 249 6.1.9 ext js选择器的总结 / 252 6.2 获取单一元素:ext.dom.element / 252 6.2.1 从错误开始 / 252 6.2.2 使用ext.get获取元素 / 253 6.2.3 使用ext.fly获取元素 / 256 ...
内容例子$ cd example$ npm i$ react-native run-ios // For ios$ react-native run-android // For Android安装npm install react-native-picker-checkbox --save 用法 import PickerCheckBox from 'react-native-...
地位安装安装作曲家 curl -sS https://getcomposer.org/installer | php编辑 composer.json {...$_POST 的例子如下: $_POST = array('username' => "",'password' => "123456",'confirm_password' => "125",'fir
不要使用Response.Redirect,而应该使用Server.Transfer e.g // in global.asax protected void Application_Error(Object sender, EventArgs e) { if (Server.GetLastError() is HttpUnhandledException) Server....
6.2.2 使用WMLScript的好处 113 6.3 WMLScript的核心 113 6.3.1 词汇结构 113 6.3.2 变量和数据类型 117 6.3.3 运算符和表达式 120 6.3.4 函数 125 6.3.5 语句 127 6.3.6 函数库 131 6.3.7 编译指示 131 6.4 数据...
" 和 "?"也编码 表格行指示 //各种尺寸 s += " 网页可见区域宽:"+ document.body.clientWidth; s += " 网页可见区域高:"+ document.body.clientHeight; s += " 网页可见区域高:"+ document.body....