私は次の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 です。何ができるか教えていただけますか?
ありがとう。