日期:2014-05-17  浏览次数:20770 次

做表单提交搜索的时候,如何根据搜索类型用js判断提交到不同页面呢
比如:
搜索类型分:
酒店(对应相应页面为a.asp),餐厅(对应相应页面为b.asp),k厅(对应相应页面为c.asp)    
在提交页面输入关键字之后   选择酒店   通过js判断就搜索去了a.asp

------解决方案--------------------
<form>
<input type= "button " value= "酒店 " onclick= "this.form.action= 'a.asp ';this.form.submit() ">
<input type= "button " value= "餐厅 " onclick= "this.form.action= 'b.asp ';this.form.submit() ">
<input type= "button " value= "k厅 " onclick= "this.form.action= 'c.asp ';this.form.submit() ">
</form>
------解决方案--------------------
wasuka说得没错吧?道理是一样的,mp3.baidu.com那是用querystring吧:
<form mathod= "get ">
<input type= "submit " name= "酒店 " onclick= "this.form.action= 'a.asp ';this.form.submit() ">
<input type= "submit " name= "餐厅 " onclick= "this.form.action= '=b.asp ';this.form.submit() ">
<input type= "submit " name= "k厅 " onclick= "this.form.action= 'c.asp ';this.form.submit() ">
</form>