Hi, i have a problem with a form that has 2 buttons and an event switcher to handle what button was clicked.
The problem appears when instead of a button click the user hits Enter on the keyboard (he has to be in the input field).
In that case none of the events is called.
How can i have a "default" button/event that will be called on keyboard Enter?
I created a demo form to show the issue, just write something in the input and click keyboard Enter[file=10770]Enter_Event_14_Jul_2018_10_42_37.cf6bak[/file]
The problem appears when instead of a button click the user hits Enter on the keyboard (he has to be in the input field).
In that case none of the events is called.
How can i have a "default" button/event that will be called on keyboard Enter?
I created a demo form to show the issue, just write something in the input and click keyboard Enter[file=10770]Enter_Event_14_Jul_2018_10_42_37.cf6bak[/file]
Two options.
1) Use JavaScript to detect when the enter key is pressed and discard the event / prevent default.
2) At the top of your submit event, have another event switcher that checks for {data.empty:button} if True use a custom code with {data.set:default} (replace default with whatever you want your default value to be), or maybe use an event loader to redo the initial event and display an error message saying they have to click a button. the Don't bother with the False condition
1) Use JavaScript to detect when the enter key is pressed and discard the event / prevent default.
2) At the top of your submit event, have another event switcher that checks for {data.empty:button} if True use a custom code with {data.set:default} (replace default with whatever you want your default value to be), or maybe use an event loader to redo the initial event and display an error message saying they have to click a button. the Don't bother with the False condition
This topic is locked and no more replies can be posted.