onfocus()在IE中工作正常但在Firefox中没有

编程入门 行业动态 更新时间:2024-10-11 07:29:05
本文介绍了onfocus()在IE中工作正常但在Firefox中没有的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经使用onchange事件验证了一个文本字段,它会抛出错误信息,如果 不满足条件并将鼠标光标设置为使用 document.focus()的相同字段。 它在IE中工作正常,但在Firefox中使用时,鼠标光标移动到下一个文本字段。 请让我知道上述问题的可能解决方案。 问候和谢谢 Sourav

解决方案

发布你的问题代码。

下面的函数验证一个只接受空格和字母的文本字段。

展开 | 选择 | Wrap | Line数字

也发布相应的HTML c颂。发布代码时请使用代码标签(请参阅如何提出问题) 。谢谢!

Hi, I have validate a text field with onchange event which throw error message, if not satisfied the condition and set the mouse cursor on the same field using document.focus(). It is working fine in IE, but when used in Firefox, the mouse cursor is moving to the next text field. Please let me know the possible solution for the above problem. Regards and Thanks Sourav

解决方案

Post your problem code.

The below function validates a text field which only accepts space and letters.

Expand|Select|Wrap|Line Numbers

Also post the corresponding HTML code. Please use code tags when posting code (See How to Ask a Question). Thanks!

更多推荐

onfocus()在IE中工作正常但在Firefox中没有

本文发布于:2023-11-25 18:12:28,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1630804.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:但在   工作   onfocus   Firefox

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!