# 帝国cms搜索页在搜索不同的数据表时调用不同的搜索模板方法

*Published:* 2024-11-04
*Author:* 客服001

#### 温馨提醒

如果文章内容或图片资源失效，请留言反馈，我们会及时处理，谢谢

本文最后更新于2024年11月4日，已超过 180天没有更新



代码参考：

```
<div class="searchBox">
<form action="/e/search/index.php" name="searchform" method="post" target="_blank" id="searchform" target="_blank">
<input type="hidden" name="tbname" value="app">
<input type="hidden" name="tempid" value="1">
<select id="soselect" name="tbname" onchange="if(this.value==='app'){document.searchform.tempid.value=1;}else{document.searchform.tempid.value=2;}">
<option value="app">APP</option>
<option value="news">资讯</option>
</select>
<input type="text" name="keyboard" id="keyboard" placeholder="">
<input type="hidden" name="show" value="title,newstext">
<button class="uk-position-center-right"><i class="icon"></i></button>
</form>
</div>
```

**注意：如果在跨表[搜索](https://www.xarjtc.com/tag/%e6%90%9c%e7%b4%a2 "查看搜索此标签更多文章")时，模板出现错位情况，需要按此处设置不缓存即可解决。**

系统 – 系统设置 – 系统参数设置 – 信息设置中把动态列表变量缓存跟动态内容页变量缓存设置为0，即不缓存。