i tried to action after blur in textfield, in blur first it work only one action, but in blur second and more the action not only one

我试图在文本字段中模糊后动作,在模糊中它首先只工作一个动作,但在模糊秒和更多动作不仅一个

$('.textsynch, .dropsynch').on('blur', function () {
    alert('asdf');
    $(this).parents('form').trigger('submit');
});

from the code first action alert 1, second alert 2, and more

来自代码第一动作警报1,第二警报2等

1 个解决方案

#1


0

if you "submit" action do not refresh your pages, I guess you may submit the form use ajax.And when the ajax is finished,The textfield may be bind event again.So when you trigger the "textfiled blur" third times.It may alert three times.You can try the code like that:

如果你“提交”动作不刷新你的页面,我想你可以提交表格使用ajax.And当ajax完成时,textfield可能再次绑定事件。所以当你触发“textfiled blur”第三次时。它可以提醒三次。您可以尝试这样的代码:

$('.textsynch, .dropsynch').on('blur', function () {

    $(this).parents('form').submit();
});

更多相关文章

  1. 输入焦点警报,没有类别或ID,在Div内
  2. php 登陆动作详解
  3. php判断手机浏览还是web浏览,并执行相应的动作
  4. 如何通过ajax将javascript数组传递给YII动作
  5. 我如何捕获并插入Meteor.Error警报从Meteor.Methods到客户端数据
  6. Javascript警报中文本的颜色
  7. 在JComboBox箭头JButton上附加动作事件

随机推荐

  1. 面试官:知道ThreadLocal嘛?谈谈你对它的理
  2. Spring【AOP模块】就这么简单
  3. Springboot整合redis(Lettuce版本)
  4. Spring【DAO模块】知识要点
  5. 阿里的OceanBase数据库世界第一,底层原来
  6. Springboot整合Websocket实现后端向前端
  7. MyBatis之Mapper XML 文件详解(六)-缓存
  8. MyBatis之Mapper XML 文件详解(四)-JDBC
  9. 计算机网络面试知识点(1)基本概述
  10. SpringBoot整合Netty搭建高性能Websocket