Issue with "Submit Button" and Return key hit delay

Hi there,

I looked at this article and learned to set the “Submit button” field so that a “Return” key hit would essentially trigger the OnClick event of the button itself.

However, when I tried implementing it in my project, there was a delay and the Return button would work awkwardly. First, it does work, but only after I clicked somewhere that was interactive (i.e. clicking anywhere didn’t work to trigger the Return, but clicking on a button or on a widget with an “OnClick” interaction worked). It also worked if I hit Return and clicked inside a text field (e.g. containing the password for a login). In both cases, it would immediately do what the OnClick button would do.

Any ideas why a Return key hit shouldn’t immediately trigger the OnClick event?

Hi rzhang!

Assigning a Submit Button to a form widget should make it so that the hitting [Return] inside a text field, for example, triggers the button’s OnClick (though the OnClick interaction takes about 1-2 seconds to trigger). Since this sounds different from what you’re experiencing, would you be able to post your RP file here for me to test? Ty!

Hi, here is my RP file attached!

The username and passwords are both admin - you can check the global variables (I know this is really bad account security design).

If you try it out, the “Account Center” login pop up works as expected with hitting Return. However, if you try the same thing with the “Account Home” pop up, you can hit Return, then click in the username text field, which then prompts the OnClick event. I don’t know why there’s a difference as both pop ups are designed exactly the same except for the naming conventions, and which pages they link to.

Example 2.rp (90.1 KB)

Edit: I think I deviated from the article in a way by putting the “Return” hit check inside the condition instead of linking the widget to the “Submit Button” area, but I did the conditional check for both Account Home and Account Center, so I’m wondering why there might be an issue here (as I said, this conditional check still works for Account Center).

Hi Rzhang

it seems you are using wrong event. Use OnKeyDown event there will be no delay once you hit Return key. Please find the updated rp file for it.

Example 2-updated.rp (90.1 KB)

Thanks for the response Anand!

While that does work, my bigger concern is that my way of getting it to work does work, but only for the “account center” side. It doesn’t seem to work for the “account home” side, even though they both have the same layout and functionality.

Hi rzhang,

The reason why the AccountCenterButton works as expected, but the accountHomeButton does not, is because the password text field in the Account Center group had a designated Submit Button (AccountCenterButton), while the password text field in the Account Home group did not:

That is, the OnFocus was not working/firing for either, but you were seeing the expected behavior for the Account Center group only because it had a targeted Submit Button. To get the intended behavior, Anand’s suggestion of moving the OnFocus interaction to the OnKeyDown event instead should help, or assigning a Submit Button to the password text field in the Account Home group should help as well.