易截截图软件、单文件、免安装、纯绿色、仅160KB

javascript问题

有一个JAVASCRIPT函数

function onCheck(){

if(document.getElementById("checKForm1").style.display=="none")
{
document.getElementByName("hasCheck").value=1;
}
else
{
document.getElementByName("hasCheck").value=0;
}
}


<input name="hasCheck" type="hidden" id="hasCheck"/>
<input type="button" value="填写开票" onclick="onCheck()" name="openCheck" style="width:100px"/>


提交表单后那个hasCheck没有数值,空的
后台我是用
String hasCheck=request.getParameter("hasCheck");

有没有人解释一下呢?
你确定JS 没出错?
我记得方法是
document.getElementByName("hasCheck").value=1;
document.getElementsByName

你的前台的那个hanCheck有值吗????

<input name="hasCheck" type="hidden" id="hasCheck"/>

前提唉就是这样,没有默认值

getElementByName 没有这个方法的 改成 getElementById

点的时候看看浏览左下角是不是出现感叹号了,如果太快了没发现的话,就先不要提交,比如:return false;


document.getElementByName("hasCheck").value=1;
document.getElementsByName

document.getElementByName("hasCheck")


相关问答:

javascript中是值是怎么交换了? - Java / Java相关

三个数x,y,z 比大小..
var x,y,z,t;
if (x>y) 
{t=x;x=y;y=t;} //交换x,y的值 
if(x>z) 
{t=z;z=x;x=t;}//交换x,z的值 
if(y>z) 
{t=y;y=z;z=t;}//交换z,y的值
这是 ......

如何用javascript在页面中动态更新某一块的内容?

我的源文件如下:
<html>
<head> <title>show picture </title>
<script>
function change(fileName)
    {
     
    ......

趣味javascript... - Web 开发 / JavaScript

我也来一个趣味javascript:
打开以下html文件,依次按下G,L,C三个键,就会有奇迹出现!!
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" ......

Javascript 获取ID

设有众多div层 希望点击到那个层,就获得那个层的id
问题是 我想把id转换成一个可以alert的数字
因为我需要这个数字来确定数组中的某一项
例如
我定义某个div的id为e1
点击他后 与之对应的数组aaa[1]中的数据返 ......

jsp中获取JavaScript中的变量

jsp页面1中:
我定义了一个变量flag
<script language="javascript"> var flag=1;</script>
jsp页面2中:
在此页面中想获取flag这个变量
<% String flag=request.getParameter(" ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号