<form name="form1" method="post" action="chaxun">
<tr  onclick="form1.submit()" >
<td>
<input type="hidden"  name="date<%=i%>" value=<%=sdfds%> />
</td>
</from>
怎么在servlet里面 取到鼠标点击后的值,我每次取到的都是的第一条啊。急救

解决方案 »

  1.   

    关键是你知道你点击的是第几条么?比如你点击第二行,form1.getDate2() 不行么。
      

  2.   

    对 就是点第几条,取到第几条的值,传给servlet里面。 大侠在写具体点呗!
      

  3.   

    写个js方法<script>
    function submitForm(v){
    document.getElementByName("date").value = v;
    document.form1.submit();
    }
    </script><form name="form1" method="post" action="chaxun">
    <input type="hidden" name="date"/>
    </from><tr onclick="submitForm(<%=sdfds%>)" >
    <td></td>
    </tr>
      

  4.   

    这个主要是你怎么获取点击的值。你获取的方式不对!!把思路清楚了,就顺了  <form name="form1" method="post" action="chaxun">
    <table border ="1">
    <tr onclick="javascript:tijiao(this);">
    <td>
    <input type="hidden" name="1" value="1" />
    </td>

    </tr>
    </table></from>   function tijiao(obj){ 
       var hidd=obj.firstChild.firstChild.value;
       alert(hidd);
    }