pass value to servlet from a hidden input type

北战南征 提交于 2020-02-05 13:56:28

问题


I am trying to pass the parameter called value in the hidden input type to my servlet. It is like that:

retour.append("<input type=\"hidden\" id=\"id_" + nomTab + "_" + compteur + "\"  value=\"" + object.getIdDailyTimeSheet() + "\"/>");
retour.append("<button id=edit name=edit type=submit onClick= editarow()>");
retour.append("<img src=edit.gif />");
retour.append("</button>");
retour.append("</td>");

But the method get parameter recommend a name to be able to get the value here. So how can I deal with it? Here I want to pass to the servlet the value of object.getIdDailyTimeSheet().


回答1:


You need to add a "Name" attribute to your Hidden field as:

retour.append(".. name=[field_name] ..");


来源:https://stackoverflow.com/questions/2904659/pass-value-to-servlet-from-a-hidden-input-type

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!