go - 如何将html表值获取到主程序
问题描述
一个例子会更好地理解我的场景。
<select name="Country" >
<option value="0"> Japan <option>
<option value="1"> Koria <option>
</select>
<table name="expense">
<tr>
<th>Month</th>
<th>Savings</th>
</tr>
<tr>
<td>January</td>
<td>100</td>
</tr>
<tr>
<td>February</td>
<td>80</td>
</tr>
</table>
<select>
r.FormValue("Country")
可以使用表单提交从主程序中检索标签的值。它将根据所选选项返回 0 或 1。
但是我怎样才能得到表值呢?
解决方案
为了从表单提交中获取表值:
您可能需要以某种方式使它们成为输入值:
<td>
<input type="text" name="color_1" value="" />
</td>
不确定这样做的目的:可以在请求参数中访问输入值。
推荐阅读
- spring-security - 有没有办法在 webflux 项目中使用 WebSecurityExpressionRoot#hasIpAddress
- python - 无法将嵌入层与 tf.distribute.MirroredStrategy 一起使用
- html - 从 iframe 中删除 Vimeo 视频控件
- web - 如果第一个输入延迟 (FID) 已经减少,块/捆绑优化对我的网站有帮助吗?
- angular - 等待信息的角垫步进延迟
- python - 如何在不使用截止方法的情况下在python中提取、比较或选择层次聚类的子聚类?
- javascript - 如何防止 iframe 文档进入全屏模式?
- javascript - 点击后从页面发送消息到弹出窗口
- php - PHP试图使用a标签将php变量链接到php脚本
- azure - 如何在使用 ARM 模板将 AD 角色分配给多个资源时使用循环