需要JQuery帮助:在更改事件之前,组合框中的哪个事件触发 [英] JQuery help needed: Which event fires in combobox before the change event

查看:136
本文介绍了需要JQuery帮助:在更改事件之前,组合框中的哪个事件触发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果用户通过使用JQuery显示警报msg来选择已经选择的语言,我想限制用户。
在更改事件之前是否有任何事件触发。

I want to restrict the user if they select the language which is already selected by displaying alert msg using JQuery. Is there any event which fires before the change event.

推荐答案

我在这种情况下所做的是:

What I did in this kind of situation was:

在更改事件中,将现有值与新选择的值进行比较。
如果值在那里,我警告消息并将组合框重置为默认选择。

In Change event, compare the existing values with newly selected one. if value is there, I alert the message and reset the combo box to default selection.

这篇关于需要JQuery帮助:在更改事件之前,组合框中的哪个事件触发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆