发表表格,但我不能得到多个数据

时间:2013-11-29 09:36:11

标签: javascript

我使用了这个表格并且我有3个数据,我用这样的形式发布了它们:

var form = document.createElement("form");
form.setAttribute("method", "post");
form.setAttribute("action", "/app/" + @appId + "/volumes/" + obj.data("rowid") + "/scheduledPublish");

var hiddenField = document.createElement("input");
hiddenField.setAttribute("type", "hidden");
hiddenField.setAttribute("name", "dateval");
hiddenField.setAttribute("value", dateval);
form.appendChild(hiddenField);

var hiddenField2 = document.createElement("input");
hiddenField2.setAttribute("type", "hidden");
hiddenField2.setAttribute("name", "hourval");
hiddenField2.setAttribute("value", hourval);
form.appendChild(hiddenField2);

var hiddenField3 = document.createElement("input");
hiddenField3.setAttribute("type", "hidden");
hiddenField3.setAttribute("name", "minuteval");
hiddenField3.setAttribute("value", minuteval);
form.appendChild(hiddenField3);

document.body.appendChild(form);
form.submit();

我怎样才能得到这些方法:

public static Result deleteVolume(Long dateval, Long appId) {
}

1 个答案:

答案 0 :(得分:0)

我解决了。我从javascript到java得到了表单数据

    form.data().get("name value")