我试图喜欢这个...但是如何纠正它并不起作用。
我想像example.com/search/[search+text]
源代码
<form name="menu_search" action="load.php" method="get" onsubmit="window.location.href = document.getElementById('videoSearch'); return false;" >
<input name="q" id="videoSearch" />
</form>
onsubmit不工作:(我也尝试这样。但它也行不通。请帮助这个。onsubmit="window.location.href = ' + value.videoSearch + '; return false;"
答案 0 :(得分:2)
尝试
<form name="menu_search" action="load.php" method="get" onsubmit="document.location.href = 'http://example.com/search/'+this.q.value+''; return false;" >
<input name="q" id="videoSearch" />
</form>