<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>
为什么不执行????
解决方案 »
- Js function里面可以嵌套吗,以及如何跳出?
- 关于window.open加载ActiveX控件的问题
- 用js改变样式的简单问题!求解!
- window.open问题
- HTTP ERROR 500 Problem accessing /web/UpdatePwdAccessAction.action. Reason:
- 地址栏的隐藏
- 请问高手:如何实现在一个窗口中点击,打开一个完全相同的另一个窗口?
- 不常见的错误!
- javascript如何复制对象?
- datagrid不能编辑怎么回事
- 检测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;
}