将值从隐藏的输入类型传递给servlet [英] pass value to servlet from a hidden input type

查看:104
本文介绍了将值从隐藏的输入类型传递给servlet的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将隐藏输入类型中名为 value 的参数传递给我的servlet。
就是这样:

$ $ p $ 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>);

但get方法的get参数推荐一个名称,以便能够在此获取值。
那么我该如何处理呢?在这里,我想将 object.getIdDailyTimeSheet()的值传递给servlet。

解决方案您需要为您的隐藏字段添加一个名称属性,如下所示:

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


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().

解决方案

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

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

这篇关于将值从隐藏的输入类型传递给servlet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆