Default button equivalent in v10

Default button equivalent in v10

  

Hi,

In our app we used to use default button parameter that was triggered when user clicked enter on software keyboard. However on mobile app v10 there is no such attribute. Is it possible to bind "enter" click on phone keyboard to trigger button click?

Our use case is that there is only two input fields and one button on the page and it is way faster to input data and click "enter" then click "done" and click button... 


Thank you for any advice.


Hi Mykola,

Do the following.

1) Place your inputs inside a form.

2) On the form add an "onsubmit" event and bind a client action (named: "OnSubmit")

3) On that OnSubmit client action place a JS Node with the following (to prevent a navigation)

window.event.preventDefault();

3) Call the button OnClick action on the OnSubmit client action 

Hi João,

I've tried this and it didn't work at all.. the "onsubmit" is not on the suggested list of form events so I've put it manually and also added alert to see if OnSubmit event is triggered. But not on device nor the browser clicking "enter" doesn't trigger this event. 

Service Studio only displays some suggestions but supports the majority of all HTML5 elements attributes.

I did this example and it works. Check out: