Input triggers on submit evet

Hello,

I’m working on a form which have an input element with an “on key down” logic to retrieve options from the DB. The problem is that when the “enter” key is pressed, it also triggers the “on submit event”.

There is a way to configure the input element the "on submit event "

PD: I duplicated the input element and when there are two of them, the “on submit event” is not triggered when the key is pressed.

Regards
Giovanny

Hello @giovanny_padilla

In order to disable such behaviour, you need to remove a Submit button in the form, or you can change the button type from “submit” to “default”.

Here is a demo page where you can test this difference https://backendlessappcontent.com/7E25B48A-05FA-0B5D-FFAE-63CC0AC26C00/A09B7B01-A9D5-43E6-AF33-6A774E4BB455/files/ui-builder/containers/default/index.html?page=submitOnInputEnter

PD: I duplicated the input element and when there are two of them, the “on submit event” is not triggered when the key is pressed.

Are you sure you have a Submit Button in the Form?

1 Like

Hello @vladimir-upirov.

Yes, I have a submit button, but at that moment is hidden. I imagine that’s why.

But your solution is the way. Thanks

Regards