文本框中显示的值是通过js获得的,
document.getElementById("show").value = newValue;怎么把这个值传给action,
小弟刚学,请各位大神们帮忙。

解决方案 »

  1.   

    document.getElementById("show").value = newValue; 不是放在show里了 
    在action里直接用request.getParameter("show")取啊
      

  2.   

    通过表单提交到后台action比如:
    <div id="operation">
    <html:form action="/fe185">
    <input type="text" name="_opCode" value="">
                <input type="submit" value="提交">
    </html:form>
    <div>
    后台可以通过String str = request.getParameter("opCode");获取
      

  3.   

    System.out.println("==="+ServletActionContext.getRequest().getParameter("show"));
    取不到值啊。
      

  4.   

    楼主你好,可以有两种方法,第一种在页面写一个隐藏元素把
    document.getElementById("show").value = newValue;
    如  <input type="hidden" name="show" value="newValue"/>这样show就有值了,到了action中就可以request.getParmeter("show")就可以取到,有一点要注意要把隐藏元素放到form表单中
    第二种:
     可以放到要跳转的action的后边如xx.do?show=newValue
    同理去action也可以用request.getParmeter("show")来取值
      

  5.   

    js里得到值   var  test = document.getElementById("").value   document.forms[0].action = "***.action?test="+test    document.forms[0].submit;request里就可以拿到了
      

  6.   

    你是把值放在了一个id="show"的html标签里了,而后台request.getParaeter("show")取值是取的name="show"的html标签的值;
    你可以这样
    <form action="" method="post">
    <input type="text" id="show" name="show"/>
    <input type="submit"/>
    </form>
    你试下吧;
      

  7.   

    给你个例子method = "post";
    action = "order.do?order_time="+document.getElementById("order_date").value+"&delivery_date="+document.getElementById("delivery_date").value+"&check_status="+document.getElementById("state").value;
    submit();直接把参数放到action中传过去
    在后台request.getP…… 接受!
      

  8.   

    window.open("printerout.action?newValue="+newValue)
    后台对你的控件用getter setter方法