首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

做表单提交搜索的时候,怎么根据搜索类型用js判断提交到不同页面呢

2012-03-13 
做表单提交搜索的时候,如何根据搜索类型用js判断提交到不同页面呢比如:搜索类型分:酒店(对应相应页面为a.a

做表单提交搜索的时候,如何根据搜索类型用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>

热点排行