按tab键时如何选择tinyMCE文本区域?
你好 我得到了类似于该代码
<form method="post" action="/" name="form" autocomplete="off">
<input type="text" name="title" />
<textarea name="body"></textarea>
<input type="text" name="tags" />
<input type="submit" name="submit" value="Send" />
</form>
“textarea”是tinyMCE...当我尝试通过输入和textarea项目移动选择时出现问题。 加载页面时,它聚焦 input[name=text] 但当我按 Tab 键时,它选择 input[name=tags] 而不是 textarea[name=body] (这是下一个) 你能帮我解决这个问题吗?
Hello
I got similar to that code
<form method="post" action="/" name="form" autocomplete="off">
<input type="text" name="title" />
<textarea name="body"></textarea>
<input type="text" name="tags" />
<input type="submit" name="submit" value="Send" />
</form>
Where the "textarea" is tinyMCE... problem comes when I try to move selection through input and textarea items.
When the page is loaded it focus input[name=text] but when I press Tab key it select input[name=tags] instead textarea[name=body] (which is next)
Can you assist me with that issue ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
这对于传统的选项卡索引来说是不可能的,因为 TinyMCE 实际上隐藏了
然后,一旦用户离开前一个输入焦点,就会跳转到 TinyMCE编辑器中,您也可以添加一个 Blur() 方法来到达下一个元素。
This is impossible with conventional tab indexes as TinyMCE actually hides the
<textarea>
and creates an<iframe>
with the editor in it. You could make a work around by forcing focus on the editor in the blur event of the previous element in javascript, here is ajQuery snipped of the top of my head:Then as soon as the user leaves the previous input focus would jump to the TinyMCE editor, you could possibly add a blur() method as well to got to the next element.
我通过向插件添加 'tabfocus' 来解决此问题,然后添加 tabfocus_elements : ":prev,:next"
http:// tinymce.moxiecode.com/wiki.php/Plugin:tabfocus
http://tinymce.moxiecode.com/wiki .php/tabfocus_elements
I resolved this with adding 'tabfocus' to plugins and then add tabfocus_elements : ":prev,:next"
http://tinymce.moxiecode.com/wiki.php/Plugin:tabfocus
http://tinymce.moxiecode.com/wiki.php/tabfocus_elements
有一个插件解决了它
http:// /sourceforge.net/tracker/index.php?func=detail&aid=1657397&group_id=103281&atid=738747
我从 TinyMCE 论坛知道它
http://tinymce.moxiecode.com/forum/viewtopic.php?id=813
There is a plugin solved it
http://sourceforge.net/tracker/index.php?func=detail&aid=1657397&group_id=103281&atid=738747
I known it from TinyMCE forum
http://tinymce.moxiecode.com/forum/viewtopic.php?id=813
我需要来自页面上另一个元素的自定义选项卡顺序。我在 IE11 中用于解决此问题的代码是
请注意,上述代码仅在页面上只有一个编辑器时才有效。否则,您将必须循环遍历
tinyMCE.get()
返回的数组,以找到要设置焦点的正确编辑器。I needed a custom tabbing order from another element on the page. The code I used to resolve this in IE11 was
Be aware that the above code will only work if you've only got one editor on the page. Otherwise you'll have to cycle through the array returned by
tinyMCE.get()
to find the correct editor to set focus to.我发现
focus
事件被触发,但在元素(容器)中聚焦并不总是有效。就我而言,我从编辑器 1 - 4 进行 Tab 键切换,当我按 Shift+Tab 键时,我失去了对实例的关注。
为了解决这个问题,我将以下内容添加到tinyMCE的设置事件中
I found out that the
focus
event is being triggered but focussing in the element (container) didn't work all the time.In my case I tabbed from editor 1 - 4 and when I shift+tab I lost focus on the instance.
To fix this I added the following to the setup event of tinyMCE