我需要提交一个表单到URL /search/
,没有任何变量名称。因此,如果我在表单中输入'foobar',它就会以GET格式将表单提交给/search/foobar
。
我怎样才能做到这一点?在我看来,没有办法用HTML,我将不得不使用jQuery。
<form action = "/search/" onsubmit="this.action += encodeURIComponent(this.term.value); this.term.disabled = 'disabled'">
<input type="text" name="term">
</form>