484
Views
7
Comments
Enter key does not trigger default button - triggers another one instead
Question

Hi all,

I have a page with multiple nested web blocks and buttons, but in the entire page I have only ONE button with the "Is Default" property set to "Yes". However, when focus is on certain inputs inside the web blocks, other random buttons are triggered instead. 

Does the enter key inside an input on a web block only triggers buttons inside that web block scope (even though they are all with "Set Default" set to "No")? It's the only explanation that I'm finding for this...

Thanks,

Inês

UserImage.jpg
G Andrew Duthie
 
MVP

Can you share an OML that reproduces the issue?

And when you say "random buttons are triggered instead" do you mean that it's not consistent?

2019-01-04 10-45-45
Sravan Vanteru

Hi Maria Inês Ponces,

Usually it should trigger button for which "Set Default" set to "Yes", but in your case very difficult to say with out seeing the code, better as Andrew suggested share OM file if not confidential.


Sravan

2017-12-13 08-27-28
Joey Moree

If I recall correctly, when pressing enter inside an input (type=text, checkbox, radio) of a form (Outsystems wraps a form around the page so you can do submits and such) the browser will look for a button with type=submit to submit the form. 

I'm not sure if Outsystems does something with the default setting though, but in your case it might be that your default button is not a submit type but ajax submit?

2020-07-21 19-28-50
Rajat Agrawal
Champion

Hi Maria,

You need to set IsDefault property to YES if you want that button to be triggered whenever you press Enter key.


I hope it will help you.


Thanks,

Rajat Agrawal

2019-01-04 10-45-45
Sravan Vanteru

Hi Rajat,

I think Maria has done same thing, his problem is different.

If you can read his post, He has multiple buttons in his page but only one button he has "Set Default" set to "Yes", still other button are getting triggered.

Any idea ?


Sravan 

2020-02-28 09-46-54
Eduardo Jauch

Hello Maria,

Could you provide a little more detail?

1. What version of OutSystems are we talking about? 9? 10? 11? Other?

2. Are your web blocks inside a Form? Are they in a List? 

3. The web blocks are put directly into the page? Are they inside other Web Blocks?

4. The default button is being put directly into the page or also inside a web block?

Cheers. 

2020-11-26 13-06-30
Joost Miltenburg

In OS 11.x.x ( Traditional ) I can confirm this still isn't working as one ( aka a user ) would expect.
It does seem to work but only when the cursor is inside a field ( eg. you are typing something and while typing you give 'enter' )

Submit and Ajax submit seems to trigger it. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.