View中代码:

<input type="text" class="searchText" id="searchText"/>
                        <input type="button" value="" onclick="Cheak()" class="searchBtn" id="searchBtn"/>
                        <script type="text/javascript">
                            function Cheak() {
                                var keys = $("#searchText").val();
                                if (keys.trim() == "")
                                { alert("请输入要搜索的内容"); return false; }
                                if (keys == "--" || keys == "'")
                                { alert("请勿输入非法字符"); return false; }

                                window.location.href = "/Search/SearchList/"+keys.toString();
                            }
                        </script>
View Code

相关文章:

  • 2022-12-23
  • 2021-11-21
  • 2022-12-23
  • 2023-03-16
  • 2022-12-23
  • 2021-07-24
猜你喜欢
  • 2021-06-07
  • 2022-12-23
  • 2022-12-23
  • 2021-11-21
  • 2022-01-28
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案