Skip to main content
KlausKi
Inspiring
March 15, 2022
Answered

How can I run dialog validation when user hits [RETURN] key?

  • March 15, 2022
  • 1 reply
  • 434 views

When the user hits the [RETURN] key on the keyboard, a currently displayed dialog is dismissed, but the defaultElement's onClick() handler is not getting called.

 

How can I run validation when the user hits the [RETURN] key, keeping the dialog from closing early?

    This topic has been closed for replies.
    Correct answer KlausKi

    My observation, hitting the [RETURN] key on the keyboard wouldn't trigger the defaultElement's onClick() handler, was wrong. Today I added an alert("Test") to the onClick() handler and it got triggered all the time.

     

    Apologies for not checking thoroughly before posting here!

    1 reply

    erinferinferinf
    Adobe Employee
    Adobe Employee
    March 15, 2022

    Hi there!

     

    I replied to your other post with more questions, the I assume this is about the same panel or script?

    KlausKi
    KlausKiAuthorCorrect answer
    Inspiring
    March 16, 2022

    My observation, hitting the [RETURN] key on the keyboard wouldn't trigger the defaultElement's onClick() handler, was wrong. Today I added an alert("Test") to the onClick() handler and it got triggered all the time.

     

    Apologies for not checking thoroughly before posting here!