我正在尝试使用vanilla javascript提交表单,但POST请求不包含输入值。
AngularJS使用ng-repeat呈现html并动态设置名称字段是否有事可做?我知道我可以用纯angularjs做到这一点,但我很好奇为什么POST请求不包含用户[n]值
<form id="form" action="myurl" method="POST">
<a title="Finalize" onclick="document.forms['form'].submit();"><i class="icon-check-circle"></i></a>
<span ng-repeat="royalty in royalties track by $index">
<input class="pull-right" type="checkbox" name="user[{{royalty.user.id}}]" ng-model="royalty.selected" value="1"/>
</span>
</form>
答案 0 :(得分:0)
似乎按预期工作:
https://plnkr.co/edit/BPQfx1vSQfug5H0uVyhT?p=preview
document.forms['testForm'].submit()
脚本
---
title: "How to trim?"
output: html_document
---
```{r setup, include=FALSE}
library(knitr)
knitr::opts_chunk$set(echo = TRUE, fig.align = 'center')
```
Include picture
```{r pic}
include_graphics("http://ggplot2.tidyverse.org/README-example-1.png")
```
ngSubmit对表单有影响,但只有当它们没有操作时才会出现,请参阅文档中的注释: