您如何建立带有表单的链接? [英] How do you build a link with a form?

查看:124
本文介绍了您如何建立带有表单的链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为简单起见,假设我有一个3字段的HTML表单,在用户完成表单并提交后,它会建立一个特殊的链接并将浏览器发送给它.

For the sake of simplicity let's say I have a 3 field HTML form, and after the user completes the form and submits, it builds a special link and sends the browser to it.

Field A (Text-input) = 1
Field B (Drop-down) = 2
Field C (Text-input) = Apples

用户提交,将用户带到:

User submits, takes user to:

myurl.com/?a=1&b=2&c='apples'

推荐答案

actionmethod属性的形式.

<form action="YOUR_URL" method="get">
<input type="text" id="a" name="a" />
<select id="b" name="b"><option value="2">2</option></select>
<input type="text" id="c" name="c" />
<input type="submit" />
</form>

这篇关于您如何建立带有表单的链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆