2016-11-21 54 views
-3

剛剛搜索白色,你是否請告知如何結合這兩個簡單的形式在一個像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> 
+0

結合在UI端的形式可以很容易做到,Point是你打算如何處理服務器端發佈的數據。你有計劃嗎? –

+0

感謝Reddy,當然,這兩種形式都可以很好地獨立工作,對於第一個頁面listItems.asp,爲mySQL獲取數據=「SELECT categoryDe​​sc,details,imageCategory FROM categories WHERE idCategory =」&pIdCategory call getFromDatabase(mySql,rsTemp,「 listItems.asp「),而第二個是BatchGeo地圖,所以它需要i + q變量(,如果你有一個想法如何合併兩個表單只有一個GO按鈕,一個SELECT和TXT框將是真棒兩個要求TEXT輸入,第一個形式用於產品,第二個爲地點 –

+0

好什麼應該是合併後的'行動'atrribute'值? –

回答

0

2 combined forms IMG EXAMPLE

第一個返回的產品例如bungees列表 .... listItems.asp?strSearch =蹦極

第二個 需要I和Q變量作爲BatchGeo座標地圖。

我看到一個劇本像如下,但我有2個行動=「頁」和每個不同的輸入名字=「...」

<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>