Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does APEX submit when I press Enter when I never programmed it to?

I discovered this behavior in Oracle APEX 4.2: you create a page with form elements and now when you press Enter in a textbox (text field), the page submits, even though you have "Submit when Enter pressed" set to No and haven't made any dynamic actions or other javascript checking for the keycode 13.

This can also end up making it look like you submitted twice: first with a blank/empty request, and then with the actual request. Interestingly, the first blank request is the only one Firefox sees, but Chrome and IE see both requests.

like image 343
Will Avatar asked Mar 13 '15 17:03

Will


1 Answers

It turns out if you have exactly one text field on your page, APEX will cause the page to submit. I found the solution here: http://deneskubicek.blogspot.com/2008/06/textfield-item-submiting-page.html

Just create another text field and give it the following in the HTML Form Element attributes: "style="display:none". Voila, all set!

like image 194
Will Avatar answered Nov 15 '22 05:11

Will