175
Views
8
Comments
Solved
Inputs open a new page when hitting Enter
Question

I am working on a form that allows users to add new "rows" to a table.

When clicking a "New" button we open a new row with 5 inputs, one text, 3 combo boxes and one check box.

Everything is working as it should, HOWEVER, when the user uses Tab and Enter to navigate the inputs the behaviour is way off. If the focus is on either of the combo boxes or on the check box and the user clicks Enter the browser navigates to a different page. The input fields are part of a normal page, not a pop up.

On the check box I would expect that clicking Enter will check / uncheck the check box, on the combo boxes it was more a test to see what happens on Enter.. 

My question is, why does clicking enter when the focus is on one of these inputs open a new page, and how can I stop that from happening? Any help would be much appreciated!


2019-06-15 21-39-22
Afonso Carvalho
 
MVP
Solution

I would suspect so. Do you have the Is Default property set to Yes in that button?

That will also point to that button when you press Enter.

2018-06-05 16-54-03
Maria da Graça Peixoto

Hi! 

What should your the "enter" button do  ?

Graça

UserImage.jpg
Christoph Karow

Maria da Graça Peixoto wrote:

Hi! 

What should your the "enter" button do  ?

Graça

On the checkbox I was expecting it to check / uncheck the checkbox.

On the combo boxes I had no expectations, I only tested them with the enter button after noticing that Enter on the check box opens a new page.

If anything, on the combo box I would think enter would be the equivalent of a right click so the combo box drop down opens. But as long as enter doesn't open a new page I think I'd be happy ??


2019-06-15 21-39-22
Afonso Carvalho
 
MVP

Hi Christoph,

The behaviour of the Enter key is going to be dependent on the browser. For instance, in most browsers, if you are focusing an element that belongs to a form, your Enter key will submit that form, not change the input values.

What elements do you have in your page? Do you have any links or buttons that will redirect you to a new page?

UserImage.jpg
Christoph Karow

Afonso Carvalho wrote:

Hi Christoph,

The behaviour of the Enter key is going to be dependent on the browser. For instance, in most browsers, if you are focusing an element that belongs to a form, your Enter key will submit that form, not change the input values.

What elements do you have in your page? Do you have any links or buttons that will redirect you to a new page?

Yes there are a lot of elements, including a back button at the bottom of the page which also links back to the page that the Enter button links back to. Is it possible that Enter somehow triggers that button?


2019-06-15 21-39-22
Afonso Carvalho
 
MVP
Solution

I would suspect so. Do you have the Is Default property set to Yes in that button?

That will also point to that button when you press Enter.

UserImage.jpg
Christoph Karow

Yes!! The back button is set to default! :) I will research what that does a bit more, but if I just set it to No, will that cause any probs i.e. does the page have to have a default button?? Thanks a mill for pointing me in this direction :) 

2019-06-15 21-39-22
Afonso Carvalho
 
MVP

I believe the page takes one (and only one) default action (link or button). If you remove the current default, it will set another.

UserImage.jpg
Christoph Karow

Sweet thanks. I'll have a look at some work arounds! Thanks for your help!

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