Skip to main content
Question

How do I make a button execute on user pressing Enter on the keyboard


I’ve built a new screen, with a PXButton on it. I want the button and more specifically the action of the button to execute when the user presses the Enter key on their keyboard. What property do I need to set on the PXButton in the ASPX file to make this happen?

3 replies

Forum|alt.badge.img+6
  • Captain II
  • 553 replies
  • March 17, 2025

Pressing enter usually only impacts the control that has focus.

Can you describe more of the screen’s purpose so we can figure out if there’s another way to invoke that logic?

 


  • Author
  • Freshman I
  • 2 replies
  • March 17, 2025

The screen is for entering data using a bar code scanner. The scanner will enter the text it reads from the barcode/qr code into a text field and press enter. I would like the “Submit” button to be pressed when it happens. The screen is designed around not all users having a barcode so they can enter the data themselves as well.


Forum|alt.badge.img+6
  • Captain II
  • 553 replies
  • March 17, 2025

Scanners can typically be configured to send additional keystrokes after the scan. That would let you press enter in the field and then you can use the CommitChanges on the field that they are scanning into. That should do what you need.


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