如何通过< option>< select>传递值形成行动 [英] How to pass value from <option><select> to form action
本文介绍了如何通过< option>< select>传递值形成行动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在我具有agent_id =
I need to pass a value in option select to action where I have agent_id=
有人可以帮助吗?
<form method="POST" action="index.php?action=contact_agent&agent_id=">
<select>
<option value="1">Agent Homer</option>
<option value="2">Agent Lenny</option>
<option value="3">Agent Carl</option>
</select>
推荐答案
您不必使用jQuery或Javascript。
You don't have to use jQuery or Javascript.
使用select的名称
标记并让表单完成它的工作。
Use the name
tag of the select and let the form do it's job.
<select name="agent_id" id="agent_id">
这篇关于如何通过< option>< select>传递值形成行动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文