【发布时间】:2020-10-28 16:07:11
【问题描述】:
我有一个选择菜单,用户可以在其中过滤作业。我想添加一个“列出所有”选项,它应该只是将它们重定向到索引页面,因为它列出了所有内容。但我不能这样做,因为我正在使用
onchange="form.submit()"
如果我将“index.php”放在这样的值中,这就是我得到的结果:
<option value="index.php">list all</option>
mypage/index.php?slct=index.php
但我应该得到这个:
mypage/index.php
试图将值留空,但这在实时服务器上不起作用:
index.php?slct=
我应该怎么做?我正在使用 select2 js,而 <a href> 不适用于它。
【问题讨论】:
-
这能回答你的问题吗? Click event in select2 tag with a link
-
2 分钟的 Google 搜索为我提供了可能对您有所帮助的上述信息。
标签: html jquery-select2