Skip to main content
Nintex Community Menu Bar
Solved

Clicking a button When the Enter key is pressed on a particular textbox

  • October 5, 2018
  • 2 replies
  • 102 views
  • Translate

I have a textbox used to search a list view.  However by default hitting Enter on a textbox does nothing.

I need to click an existing button when people hit enter while on that search textbox.
I tried this JS

<script> $('[name="Search Box"]').keyup(function(event) { if (event.keyCode == 13) { $('[name="Refresh"]').click(); } }); </script>

("Search Box" being the name of the textbox, and Refresh being the name of the button, however I have tried it several times and the button does not get clicked when I hit enter. I have also tried .keypress instead of .keyup and neither work. The Data label is set to literal)

 

I know this has been asked before but the above was the solution, and it is not working for me.
Running K2 4.7

Thanks

Best answer by davidedpg10

My bad, it was the button name that was wrong..
It was "Refresh_Button" not "Refresh"
View original

2 replies

  • Author
  • 40 replies
  • October 5, 2018

Yes, The datalabel is literal and not visible.

It is not executing though, or at least not clicking the button when I hit enter while typing in the textbox.
I have no idea why. It should work.

Translate

  • Author
  • 40 replies
  • Answer
  • October 5, 2018
My bad, it was the button name that was wrong..
It was "Refresh_Button" not "Refresh"
Translate

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie Settings