热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

如何从Excel中的VBA代码调用IE'onblur'事件?-HowdoIinvoketheIE'onblur'eventfromVBAcodeinExcel?

Situation:IamworkingtopopulatetextentryboxesinawebpagewithdatafromExcel.Whenthedat

Situation: I am working to populate text entry boxes in a webpage with data from Excel. When the data is entered manually and the focus is moved to another text box, the 'onblur' event is fired to do input validation.

情况:我正在使用Excel中的数据填充网页中的文本输入框。手动输入数据并将焦点移动到另一个文本框时,会触发'onblur'事件以进行输入验证。

Desire: I want to be able to cause the 'onblur' event to be fired when I populate the same text boxes from VBA code in Excel.

Desire:当我从Excel中的VBA代码填充相同的文本框时,我希望能够触发'onblur'事件。

Question: How do I cause the 'onblur' event to be executed?

问题:如何执行'onblur'事件?

2 个解决方案

#1


I'm assuming you have access to the DOM, in which case you should be able to use

我假设您可以访问DOM,在这种情况下您应该可以使用

document.getElementById(*element*).fireEvent("onblur");

#2


Unless I have misunderstood your question, you want to know the VBA equivlant of OnBlur. That event is MyTextBox_Exit in VBA.

除非我误解了你的问题,否则你想知道VBA对OnBlur的影响。该事件是VBA中的MyTextBox_Exit。


推荐阅读
author-avatar
没有你的日子1976_472
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有