imacros:提交textarea表单(也许输入密钥?) [英] imacros: submitting textarea form (enter key maybe?)
问题描述
问题::如何模拟ENTER(在实时聊天中提交文本)? (如果还有使用ENTER键的替代方法,例如在imacros中使用javascript触发事件,那也很好)
Question: How to simulate an ENTER (to submit a text in a live chat)? (if there is an alternative to using the ENTER key, like using javascript in imacros to trigger an event, that would be great too)
说明:
我试图在使用<textarea>
元素进行输入的实时聊天中提交评论.这是源代码:
I am trying to submit a comment in a live chat that uses a <textarea>
element for input. Here is the source code:
<form class="chatbox nolabel">
<textarea class="textbox" type="text" size="70" autocomplete="off" name="message" style="resize: none; overflow-y: hidden;"></textarea>
</form>
我尝试了各种不同的输入单词"hello"并按ENTER键(以便向阅读的用户发送问候)的方法,但是我唯一能做的就是输入单词"hello".
I have attempted various different approaches of inputting the word "hello" and pressing the ENTER key (so that hello is sent to the users reading), however the only thing I am capable of doing is inputting the word "hello".
尝试1:
TAG POS=1 TYPE=TEXTAREA FORM=NAME:NoFormName ATTR=NAME:message CONTENT=hi
尝试1的结果
录制时,这是我开始在文本区域中键入时出现的代码,它成功地将内容放入了textarea
中,但是当我按ENTER键时没有看到任何代码被录制,因此我假设在这种情况下就是问题所在.
Results from Attempt 1:
When recording, this is the code that appeared when I started typing in the text area, and it successfully places the content into the textarea
, however I didn't see any code being recorded when I press the ENTER key, so I assume that is the issue in this case.
尝试2:(事件记录模式)
EVENTS TYPE=KEYPRESS SELECTOR="HTML>BODY>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>DIV>DIV:nth-of-type(2)>FORM>TEXTAREA:nth-of-type(2)" CHARS="hi"
WAIT SECONDS=1
EVENT TYPE=KEYPRESS SELECTOR="HTML>BODY>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>DIV>DIV:nth-of-type(2)>FORM>TEXTAREA:nth-of-type(2)" KEY=13
尝试1的结果 在这种情况下,我尝试将Keypress类型与事件一起使用,以模拟按下ENTER键的操作,但是结果是得到了"hi(newline)".
Results from Attempt 1: In this case, I tried using the Keypress type with events to simulate hitting the ENTER key, however what resulted was getting a "hi(newline)".
有什么想法吗?
推荐答案
有时其他关键事件类型可能会有所帮助:
Sometimes other key event types may help:
EVENT TYPE=KEYDOWN SELECTOR="HTML>BODY>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>DIV>DIV:nth-of-type(2)>FORM>TEXTAREA:nth-of-type(2)" KEY=13
或
EVENT TYPE=KEYUP SELECTOR="HTML>BODY>DIV:nth-of-type(2)>DIV>DIV>DIV>DIV>DIV>DIV:nth-of-type(2)>FORM>TEXTAREA:nth-of-type(2)" KEY=13
这篇关于imacros:提交textarea表单(也许输入密钥?)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!