0

私は次のJavaScript関数を持っています:

function confirmaEnviar()
    {        


          document.getElementById("data").value =clave2.value;

        alert(document.getElementById("data").value);
   more code here

私が確認したところで、新しい値 tu data; を割り当てることができます。

データは次のように定義されています。

 <form action="client.json" method="post" name="usuario" id="usuario">

 more code here

 <input  type="hidden" name="data" id="data" value="prueba" />

 more code here

 </form>

後でjsp部分で:

      <div><a href="javascript:void();" onclick="       
   javascript:if(confirmaEnviar())$('#usuario').submit();

 <%
<%
 more code here

 String str= request.getParameter("data");

str は常に null です。何ができるか教えていただけますか?

ありがとう。

4

2 に答える 2

4

属性 action="client.json" を action="client.jsp" に変更したと思います。

ページがリクエストパラメーターを取得できない可能性があります..と思います。

于 2013-09-04T05:37:06.033 に答える