简单的js验证没有触发。 [英] Simple js validation not firing.

查看:60
本文介绍了简单的js验证没有触发。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我有一段脚本由于某些原因没有启动,这里是脚本,

Hi all,
I have a piece of script which for some reasons is not firing up, herez the script,

展开 | 选择 | Wrap | 行号

推荐答案

在isDate函数中,将expenseqryForm替换为form(作为参数传递给函数的变量)。
In the isDate functions, replace expenqryForm with form (the variable passed as an argument to the function).



在isDate函数中,将expenseqryForm替换为form(作为参数传递给函数的变量)。
In the isDate functions, replace expenqryForm with form (the variable passed as an argument to the function).



你好。我尝试了但是没有用,可能是什么问题...

这是我完整的jsp页面....

[HTML]

< html>

< head>

< title> PAYMENT DETAIL QUERY< / title>

< meta HTTP的当量= QUOT;内容类型"含量=" text / html的; charset = ISO-8859-1">

< SCRIPT LANGUAGE =" JavaScript" SRC =" ipubscript1.js">< / SCRIPT>

< script type =" text / javascript" SRC =" calendar1.js">< / script>

< script type =" text / javascript">

function forward(control)< br $>
{

var branch = control.value;

location.href =" /publicity/ExpenQryAction.do?branch =" +分支;

}

函数messageValue()

{

var messageIndex = document.expenqryForm.branch。 selectedIndex;

var selectedValue = document.expenqryForm.branch.options [messageIndex] .value;

document.expenqryForm.branch.value = selectedValue;

document.expenqryForm.publicity_Code.selectedIndex;

document.expenqryForm.submit();

}

函数messValue()

{

var messIndex = document.expenqryForm.publicity_Code.sel ectedIndex;

var selValue = document.expenqryForm.publicity_Code.options [messageIndex] .value;

document.expenqryForm.publicity_Code.value = selecte dValue;

document.expenqryForm.submit();

}

< / script>

< / head>

< body topmargin =" 0" LEFTMARGIN = QUOT; 0" bgproperties =" fixed">


< div align =" left">

< form name =" expenseqryForm"方法= QUOT;交"行动= QUOT; /publicity/ExpenQryAction.do" onsubmit =" return everything(this);">


< table border =" 0" width =" 100%">

< tr>

< td width =" 100%" BGCOLOR = QUOT;#DFDFFF" background =" images / niceblue.gif">< font face =" Tahoma"

color ="#000000">< strong> P aymen t& nbsp;&   Q uer y< / strong>< / font>< / td>

< / tr>

< / table>

< div align =" left">


< table border =" 0" CELLPADDING = QUOT; 0" CELLSPACING = QUOT; 0"宽度= QUOT; 100%QUOT; height =" 109">

< tr>

< td width =" 35%" height =" 42">< / td>

< td width =" 65%" height =" 42">< / td>

< / tr>

< tr>

< td width = QUOT; 35%" height =" 25">< strong>< small>< font face =" Verdana">申请代码< / font>< / small>< / strong>< / td>

< td width =" 65%" height =" 25">

< input type =" text"名称= QUOT; req_Code" MAXLENGTH = QUOT; 10"大小= QUOT; 8英寸value ="">


< / td>

< / tr>

< tr>

< td width =" 35%" height =" 21">< small>< strong>< font face =" Verdana">派对名称< / font>< / strong>< / small>< / td>

< td width =" 65%" height =" 21">

< input type =" text"名称= QUOT; party_Name" MAXLENGTH = QUOT; 255"大小= QUOT; 8英寸value ="">


< / td>

< / tr>

< tr>

< td width =" 35%" height =" 21">< strong>< small>< font face =" Verdana">来自Bill Date< / font>< / small>< / strong>< / td>

< td width =" 65%" height =" 21">< strong>< small>< font face =" Verdana">

< input type =" text"名称= QUOT; FROM_DATE" MAXLENGTH = QUOT; 8英寸大小= QUOT; 8英寸值= QUOT;" readonly =" readonly">

< a href =" javascript :cal1.popup();">< img src =" images /cal.gif"宽度= QUOT; 16"高度= QUOT; 16"边界=" 0" alt ="点击此处接听日期">< / a>< br>


< / font>< / small>< / strong> < / td>

< / tr>

< tr>

< td width =" 35%" height =" 21">< small>< strong>< font face =" Verdana"> To Bill Date< / font>< / strong>< / small>< / td>

< td width =" 65%" height =" 21">< small>< strong>< font face =" Verdana">

< input type =" text"名称= QUOT; TO_DATE" MAXLENGTH = QUOT; 8英寸大小= QUOT; 8英寸值= QUOT;" readonly =" readonly">

< a href =" javascript :cal2.popup();">< img src =" images /cal.gif"宽度= QUOT; 16"高度= QUOT; 16"边界=" 0" alt ="点击此处接听日期">< / a>< br>

< / font>< / strong>< / small>< / td> ;

< / tr>

< tr>

< td width =" 35%" height =" 21">< small>< strong>< font face =" Verdana"> Less than Amount< / font>< / strong>< / small>< / td>

< td width =" 65%" height =" 21">< small>< strong>< font face =" Verdana">

< input type =" text"名称= QUOT; less_Amt" MAXLENGTH = QUOT; 10"大小= QUOT; 8英寸value ="">


< / font>< / strong>< / small>< / td>

< / tr>

< tr>

< td width =" 35%" height =" 21">< strong>< small>< font face =" Verdana">大于金额< / font>< / small>< / strong>< / td>

< td width =" 65%" height =" 21">< small>< strong>< font face =" Verdana">

< input type =" text"名称= QUOT; greater_Amt" MAXLENGTH = QUOT; 10"大小= QUOT; 8英寸value ="">


< / font>< / strong>< / small>< / td>

< / tr>


< tr>

< td width =" 35%" height =" 21">< small>< strong>< font face =" Verdana"> Branch< / font>< / strong>< / small>< / td>

< td width =" 65%" height =" 21">< strong>< font face =" Verdana">< small>< / small>< / font>< / strong>

< select name =" branch"大小= QUOT 1 QUOT; onChange =" messageValue()">

< option value ="">< option>

< option value =" Bombay" ;选择> Bombay< /选项>

< option value ="德里" >德里< /选项>

< option value =" Ahmedab​​ad" > Ahmedab​​ad< / option>

< option value =" Madras" > Madras< / option>

< option value =" Bangalore" > Bangalore< / option>

< option value =" Calcutta" >加尔各答< / option>

< option value =" Hyderabad" > Hyderabad< / option>

< option value =" Pune" > Pune< / option>

< option value =" Lucknow" > Lucknow< / option>

< option value =" Jaipur" > Jaipur< / option>

< option value =" Patna" > Patna< / option>

< option value =" Cochin" > Cochin< / option>

< option value =" Chandigarh" > Chandigarh< / option>

< option value =" Bhopal" > Bhopal< / option>

< option value =" x"> ------------------------ -------< option>

< / select>

< strong>< font face =" Verdana">< small> ;< / small>< / font>< / strong>< / td>

< / tr>


< tr>

< td width =" 35%" height =" 21">< small>< strong>< font face =" Verdana"> Publicity Head< / font>< / strong>< / small>< / td>

< td width =" 65%" height =" 21">< strong>< font face =" Verdana">< small>< / small>< / font>< / strong>

< select name =" publicity_Code" size =" 1">


< option value ="">(全选)< / option>


< option value =" 41604"选择> 41604< / option>


< / select>

< strong>< font face =" Verdana" >< small>< / small>< / font>< / strong>< / td>

< / tr>


< tr>

< td width =" 35%" height =" 21">< small>< strong>< font face =" Verdana">支出类型< / font>< / strong>< / small>< / td>

< td width =" 65%" height =" 21">< strong>< font face =" Verdana">< small>< / small>< / font>< / strong>

< select name =" expenditure_Code" size =" 1">< option value ="">< / option>


< option value =" 41604101">商品费用< ; / option>< / select>


< strong>< font face =" Verdana">< small>< / small>< ; / font>< / strong>< / td>

< / tr>

< / table>

< / div>< div align =" left">


< table width =" 70%">

< tr> ;

< td width =" 50%">< p align =" left">


< ; input type =" submit"命名= QUOT; thesubmit" value =" Submit">

< input type =" reset"命名= QUOT;重置" value ="重置">


< / td>

< td width =" 50%">< p align =" center">< / td>

< / tr>

< / table>

< / div> ;


< dd align =" center">< br>

< / dd>

< ; / form>

< script type =" text / javascript">

var cal1 = new calendar1(document.forms [''expenseqryForm'']。 elements [''from_Date'']);

< / script>

< script type =" text / javascript">

var cal2 = new calendar1(document.forms [''expenseqryForm'']。elements [''to_Date'']);

< / script>

< / div>

< / body>

< / html>

[/ HTML]

Hi acoder. I tried that but that didnt work though, what may be the problem...
this is my complete jsp page....
[HTML]
<html>
<head>
<title>PAYMENT DETAIL QUERY</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<SCRIPT LANGUAGE="JavaScript" SRC="ipubscript1.js"></SCRIPT>
<script type="text/javascript" SRC="calendar1.js"></script>
<script type="text/javascript">
function forward(control)
{
var branch = control.value;
location.href="/publicity/ExpenQryAction.do?branch=" +branch;
}
function messageValue()
{
var messageIndex = document.expenqryForm.branch.selectedIndex;
var selectedValue = document.expenqryForm.branch.options[messageIndex].value;
document.expenqryForm.branch.value = selectedValue;
document.expenqryForm.publicity_Code.selectedIndex ;
document.expenqryForm.submit();
}
function messValue()
{
var messIndex=document.expenqryForm.publicity_Code.sel ectedIndex;
var selValue = document.expenqryForm.publicity_Code.options[messageIndex].value;
document.expenqryForm.publicity_Code.value=selecte dValue;
document.expenqryForm.submit();
}
</script>
</head>
<body topmargin="0" leftmargin="0" bgproperties="fixed">

<div align="left">
<form name="expenqryForm" method="post" action="/publicity/ExpenQryAction.do" onsubmit="return everything(this);">

<table border="0" width="100%">
<tr>
<td width="100%" bgcolor="#DFDFFF" background="images/niceblue.gif"><font face="Tahoma"
color="#000000"><strong>P a y m e n t&nbsp;&nbsp;Q u e r y</strong></font></td>
</tr>
</table>
<div align="left">

<table border="0" cellpadding="0" cellspacing="0" width="100%" height="109">
<tr>
<td width="35%" height="42"></td>
<td width="65%" height="42"></td>
</tr>
<tr>
<td width="35%" height="25"><strong><small><font face="Verdana">Requisition Code</font></small></strong></td>
<td width="65%" height="25">
<input type="text" name="req_Code" maxlength="10" size="8" value="">

</td>
</tr>
<tr>
<td width="35%" height="21"><small><strong><font face="Verdana">Party Name </font></strong></small></td>
<td width="65%" height="21">
<input type="text" name="party_Name" maxlength="255" size="8" value="">

</td>
</tr>
<tr>
<td width="35%" height="21"><strong><small><font face="Verdana">From Bill Date </font></small></strong></td>
<td width="65%" height="21"><strong><small><font face="Verdana">
<input type="text" name="from_Date" maxlength="8" size="8" value="" readonly="readonly">
<a href="javascript:cal1.popup();"><img src="images/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the date"></a><br>

</font></small></strong></td>
</tr>
<tr>
<td width="35%" height="21"><small><strong><font face="Verdana">To Bill Date </font></strong></small></td>
<td width="65%" height="21"><small><strong><font face="Verdana">
<input type="text" name="to_Date" maxlength="8" size="8" value="" readonly="readonly">
<a href="javascript:cal2.popup();"><img src="images/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the date"></a><br>
</font></strong></small></td>
</tr>
<tr>
<td width="35%" height="21"><small><strong><font face="Verdana">Less than Amount </font></strong></small></td>
<td width="65%" height="21"><small><strong><font face="Verdana">
<input type="text" name="less_Amt" maxlength="10" size="8" value="">

</font></strong></small></td>
</tr>
<tr>
<td width="35%" height="21"><strong><small><font face="Verdana">Greater than Amount</font></small></strong></td>
<td width="65%" height="21"><small><strong><font face="Verdana">
<input type="text" name="greater_Amt" maxlength="10" size="8" value="">

</font></strong></small></td>
</tr>


<tr>
<td width="35%" height="21"><small><strong><font face="Verdana">Branch</font></strong></small></td>
<td width="65%" height="21"><strong><font face="Verdana"><small></small></font></strong>
<select name="branch" size="1" onChange="messageValue()">
<option value=""><option>
<option value="Bombay" selected>Bombay</option>
<option value="Delhi" >Delhi</option>
<option value="Ahmedabad" >Ahmedabad</option>
<option value="Madras" >Madras</option>
<option value="Bangalore" >Bangalore</option>
<option value="Calcutta" >Calcutta</option>
<option value="Hyderabad" >Hyderabad</option>
<option value="Pune" >Pune</option>
<option value="Lucknow" >Lucknow</option>
<option value="Jaipur" >Jaipur</option>
<option value="Patna" >Patna</option>
<option value="Cochin" >Cochin</option>
<option value="Chandigarh" >Chandigarh</option>
<option value="Bhopal" >Bhopal</option>
<option value="x">-------------------------------<option>
</select>
<strong><font face="Verdana"><small></small></font></strong></td>
</tr>

<tr>
<td width="35%" height="21"><small><strong><font face="Verdana">Publicity Head</font></strong></small></td>
<td width="65%" height="21"><strong><font face="Verdana"><small></small></font></strong>
<select name="publicity_Code" size="1">

<option value="">(select all)</option>

<option value="41604" selected >41604</option>

</select>

<strong><font face="Verdana"><small></small></font></strong></td>
</tr>

<tr>
<td width="35%" height="21"><small><strong><font face="Verdana">Expenditure Type</font></strong></small></td>
<td width="65%" height="21"><strong><font face="Verdana"><small></small></font></strong>
<select name="expenditure_Code" size="1"><option value=""></option>

<option value="41604101">Cost Of Items</option></select>


<strong><font face="Verdana"><small></small></font></strong></td>
</tr>
</table>
</div><div align="left">

<table width="70%">
<tr>
<td width="50%"><p align="left">


<input type="submit" name="thesubmit" value="Submit">
<input type="reset" name="reset" value="Reset">

</td>
<td width="50%"><p align="center"></td>
</tr>
</table>
</div>

<dd align="center"><br>
</dd>
</form>
<script type="text/javascript">
var cal1 = new calendar1(document.forms[''expenqryForm''].elements[''from_Date'']);
</script>
<script type="text/javascript">
var cal2 = new calendar1(document.forms[''expenqryForm''].elements[''to_Date'']);
</script>
</div>
</body>
</html>
[/HTML]


isDate函数现在看起来像什么?你有任何错误吗?
What do the isDate functions look like now? Do you get any errors?


这篇关于简单的js验证没有触发。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆