Select2-使用最大选项限制消息中的链接

时间:2019-03-10 17:05:41

标签: javascript jquery jquery-select2 select2-rails

因此,我只希望我的用户在收到将其定向到升级页面的消息之前,能够选择3个选项。

我已经成功显示了带有链接的消息,但是用户无法单击它。进入该页面的唯一方法是右键单击并在新的标签/窗口中打开。

Javascript:

$(".js-source-states-2").select2({
  maximumSelectionSize: 3,
  formatSelectionTooBig: function (limit) {

  // Callback

  return 'You can only select 3 items (Upgrade to <a target="_blank" href="/charges/new">Premium</a>)';
  },
  placeholder: "Select Condition(s)"
});

按我认为可能的方式工作:

尽管该链接是不可单击的,但即使将光标更改为允许您将鼠标悬停在其上方并在浏览器的左下角显示该链接,也可以单击它。

Image of output of the above code, however not able to click the link

0 个答案:

没有答案