【发布时间】:2017-05-18 18:32:14
【问题描述】:
我有一个 12 列的表。每一列都有一个下拉列表作为“是”和“否”的值。下拉列表中的默认值为“是”。我想在点击提交按钮时发送选定的数据。
<!DOCTYPE html>
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
</head>
<style>
table {
border-collapse: collapse;
margin:0 auto;
}
table, td, th {
border: 1px solid black;
}
</style>
<body>
<table>
<tr>
<th>Month 1</th>
<th>Month 2</th>
<th>Month 3</th>
<th>Month 4</th>
<th>Month 5</th>
<th>Month 6</th>
<th>Month 7</th>
<th>Month 8</th>
<th>Month 9</th>
<th>Month 10</th>
<th>Month 11</th>
<th>Month 12</th>
</tr>
<tr>
<td><select>
<option>Yes</option>
<option>No</option>
</select></td>
<td><select>
<option>Yes</option>
<option>No</option>
</select></td>
<td><select>
<option>Yes</option>
<option>No</option>
</select></td>
<td><select>
<option>Yes</option>
<option>No</option>
</select></td>
<td><select>
<option>Yes</option>
<option>No</option>
</select></td>
<td><select>
<option>Yes</option>
<option>No</option>
</select></td>
<td><select>
<option>Yes</option>
<option>No</option>
</select></td>
<td><select>
<option>Yes</option>
<option>No</option>
</select></td>
<td><select>
<option>Yes</option>
<option>No</option>
</select></td>
<td><select>
<option>Yes</option>
<option>No</option>
</select></td>
<td><select>
<option>Yes</option>
<option>No</option>
</select></td>
<td><select>
<option>Yes</option>
<option>No</option>
</select></td>
</tr>
</table>
<input type="submit" name="submit" ng-click="getValue()">
</body>
</html>
这是我的桌子。如何编写使用 get 或 post 方法发送所选数据的 angularjs 代码。
【问题讨论】: