将两种形式合二为一

时间:2016-11-21 13:14:57

标签: javascript html asp.net forms

只是徒劳地搜索,你会建议如何将这两种简单形式结合起来如BOX + SELECT + BUTTON 跨栏给我的是将两个不同的动作=“.. asp”合并到ASP的一个脚本中。

<form action="listItems.asp">
    <label>
        <input type="text" name="strSearch" placeholder="Products"> 
    </label>
    <input type="submit" value="GO">
</form>


<form action="listlocations.asp" >
    <label>
        <input type="text" name="q" placeholder="Locations">
        <input type="hidden" name="i" value="61b42810d83e6feaca5bb3ca7b3e76cd" scrolling="no">
    </label>
    <input type="submit" value="GO">
</form>

1 个答案:

答案 0 :(得分:0)

2 combined forms IMG EXAMPLE

第一个返回产品列表示例橡皮筋 .... listItems.asp?strSearch =蹦极

第二个 需要i和q变量作为BatchGeo map的坐标。

我看到如下脚本,但我有2个动作=&#34; page&#34;并且每个输入名称不同=&#34; ...&#34;

<script type="text/javascript">
function dosearch() {
var sf=document.searchform;
var submitto = sf.sengines.options[sf.sengines.selectedIndex].value + escape(sf.searchterms.value);
window.location.href = submitto;
return false;
}
</script>

<form name="searchform" onSubmit="return dosearch();">
<input type="text" name="searchterms">
<select name="sengines">
<option value="http://www.google.com/search?q=" selected>Dealers</option>
<option value="http://www.altavista.com/web/results?q=">Products</option>
</select>
<input type="submit" value="GO">
</form>
相关问题