<script type="text/javascript">
function checkInput(){
var startDate = document.getElementById("d11").value;
var node = document.getElementById("d12").value;
var endDate = document.getElementById("d13").value;
var phase = document.getElementById("d14").value;
alert("node:" + node+"||");
alert("phase:" + phase+"||");
alert(startDate > endDate);
if(startDate =="" || null == startDate){
alert("请输入起始日期");
return;
}
if(endDate =="" || null == endDate){
alert("请输入截止日期");
return;
}
if(startDate < endDate){
alert("截止日期不能小于起始日期");
return;
}
if(node =="" || null == node){
alert("请输入节点号");
return;
}
if(phase =="" || null == phase){
alert("请输入相位");
return;
}
}
</script>
为什么不执行????
function checkInput(){
var startDate = document.getElementById("d11").value;
var node = document.getElementById("d12").value;
var endDate = document.getElementById("d13").value;
var phase = document.getElementById("d14").value;
alert("node:" + node+"||");
alert("phase:" + phase+"||");
alert(startDate > endDate);
if(startDate =="" || null == startDate){
alert("请输入起始日期");
return;
}
if(endDate =="" || null == endDate){
alert("请输入截止日期");
return;
}
if(startDate < endDate){
alert("截止日期不能小于起始日期");
return;
}
if(node =="" || null == node){
alert("请输入节点号");
return;
}
if(phase =="" || null == phase){
alert("请输入相位");
return;
}
}
</script>
为什么不执行????
解决方案 »
- 用户留言,增加剩余字数提示
- jquery 选取的问题,
- 隐藏/关闭层的问题
- 向老大们请教一个JS问题
- 关于javascript代码解密
- 如何用js修改背景图片的位置?
- 有没有可以在网页上拖动一个层,并随着拖动层页面自动伸展(有的拖到页面外面就找不到了,也就是没有出现滚动条)的例子.
- 如何判断用户输入的数据类型?!(在线等!急。。。。。。。。。。!)
- javascript的background问题。
- 怎样用脚本实现:根据屏幕的分辨率设置<object width=xx height=yy></object>中的宽和高?
- 检测flash是否安装 以及版本号 ,找了很多 , 都不好用
- Ajax聊天室,当有消息时,用户输入框内丢失光标,导致用户无法正常输入文字
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<style type="text/css">
.query {
width: 50px;
height: 50px;
}
.select {
}
.textArea {
width: 1250px;
height: 200px;
align: center;
}
</style>
<script type="text/javascript" src="My97DatePicker/WdatePicker.js"></script>
</head>
<script type="text/javascript">
function checkInput(){
var startDate = document.getElementById("d11").value;
var node = document.getElementById("d12").value;
var endDate = document.getElementById("d13").value;
var phase = document.getElementById("d14").value;
alert("node:" + node+"||");
alert("phase:" + phase+"||");
alert(startDate > endDate);
if(startDate =="" || null == startDate){
alert("请输入起始日期");
return;
}
if(endDate =="" || null == endDate){
alert("请输入截止日期");
return;
}
if(startDate < endDate){
alert("截止日期不能小于起始日期");
return;
}
if(node =="" || null == node){
alert("请输入节点号");
return;
}
if(phase =="" || null == phase){
alert("请输入相位");
return;
}
}
</script>
<body bgcolor="#F0F0F0">
<fieldset>
<fieldset>
<legend>查询条件</legend>
<div align="center">
<form action="queryInfo.do" method="post" id = "form1">
<table class="select">
<tr>
<td>
<table>
<tr>
<td>查询日期从 <input id="d11" name="startDate" type="text" onClick="WdatePicker()"/></td>
<td> 节点 <select name="node">
<option value="Node1"> 节点1 </option>
<option value="Node2"> 节点2 </option>
<option value="Node3"> 节点3 </option>
<option value="Node4"> 节点4 </option>
</select>
</td>
</tr>
<tr>
<td> 到 <input id="d13" name="endDate" type="text" onclick="WdatePicker()"/></td>
<td> 相位 <select name="phase">
<option value="1"> A相位 </option>
<option value="2"> B相位 </option>
<option value="3"> C相位 </option>
</select></td>
</tr>
</table>
</td>
<td align="right">
<input type="submit" class="query" name = "submit" value="查询" onclick="checkInput()"/>
</td>
</tr>
</table>
</form>
</div>
</fieldset>
<br/>
<fieldset>
<legend>查询结果</legend>
<div align="center">
<table>
<tr>
<td>
<input class="textArea" type="textArea" name="resultSet"/>
</td>
</tr>
</table>
</div>
</fieldset>
</fieldset>
</body>
</html>
<html>
<head>
<base href="<%=basePath%>">
<style type="text/css">
.query {
width: 50px;
height: 50px;
}
.select {}
.textArea {
width: 1250px;
height: 200px;
align: center;
}
</style></head>
<script type="text/javascript">
function checkInput(){
var startDate = document.getElementById("d11").value;
var node = document.getElementById("d12").value;
var endDate = document.getElementById("d13").value;
var phase = document.getElementById("d14").value;alert("node:" + node+"||");
alert("phase:" + phase+"||");
alert(startDate > endDate);
if(startDate =="" || null == startDate){
alert("请输入起始日期");
return false;
}
if(endDate =="" || null == endDate){
alert("请输入截止日期");
return false;
}
if(startDate < endDate){
alert("截止日期不能小于起始日期");
return false;;
}
if(node =="" || null == node){
alert("请输入节点号");
return false;;
}
if(phase =="" || null == phase){
alert("请输入相位");
return false;;
}
}
</script>
<body bgcolor="#F0F0F0">
<fieldset>
<fieldset>
<legend>查询条件</legend>
<div align="center">
<form action="queryInfo.do" method="post" id = "form1" onsubmit="return checkInput()">
<table class="select">
<tr>
<td>
<table>
<tr>
<td>查询日期从 <input id="d11" name="startDate" type="text" /></td>
<td> 节点 <select name="node" id="d12">
<option value="Node1"> 节点1 </option>
<option value="Node2"> 节点2 </option>
<option value="Node3"> 节点3 </option>
<option value="Node4"> 节点4 </option>
</select>
</td>
</tr>
<tr>
<td> 到 <input id="d13" name="endDate" type="text" onclick="WdatePicker()"/></td>
<td> 相位 <select name="phase" id="d14">
<option value="1"> A相位 </option>
<option value="2"> B相位 </option>
<option value="3"> C相位 </option>
</select></td>
</tr>
</table>
</td>
<td align="right">
<input type="submit" class="query" name = "submit" value="查询" />
</td>
</tr>
</table>
</form>
</div>
</fieldset>
<br/>
<fieldset>
<legend>查询结果</legend>
<div align="center">
<table>
<tr>
<td>
<input class="textArea" type="textArea" name="resultSet"/>
</td>
</tr>
</table>
</div>
</fieldset>
</fieldset>
</body>
</html>
http://so.csdn.net/search?q=%E6%97%A5%E6%9C%9F%E6%AF%94%E8%BE%83%E5%A4%A7%E5%B0%8F%20%20javascript
if(startDate > endDate){
alert("截止日期不能小于起始日期");
return;
}判断条件写错了……
alert("截止日期不能小于起始日期");
return;
}