Normaly, if there are page items of type "Text Field" they will not submit the page unless you change them to "Text Field (always submits page when Enter pressed)". If you have only one item on you page of type "Text Field" this behaviour changes and the page will always submit if you press "Enter". Sometimes, you don't want this to happen. Especially, if you have some javascript attached to your field. To avoid that you can use the following trick:
1. create another item on you page of type "Text Field",
2. in the "HTML Form Element Attributes" of that item put
style="display:none"
The result is that the second item will not be displayed and the first item will not submit on pressing "Enter".
Now I finally know why some of my text fields do a submit without that I have told them to do so.
ReplyDeleteThanks for the hint :).
Very nice topic! I was having some headaches because this, thanks a lot!!
ReplyDeleteThanks Denes,
ReplyDeleteI had a one-item page (for updating) and using a barcode-scanner for input. It always 'generated' a press Enter without me submitting. Your 'trick' works fine!
13 years later. APEX is 20.2. It still works.
ReplyDeleteStill works in 2022, I have a barcode scanner that automatically enters. Just added the second text field and hiding it works like a charm. Thank you!
ReplyDelete-Eva
Added the extra item and hid it, works like a charm in 2022, the automatic enter is disabled. Thank you!
ReplyDelete