Flex Form Fields Submit on Enter
It’s just a small thing but it can be quite annoying when you have to use the mouse in order to submit a form, particularly something like a login form where you just want to quickly type in your details and get into the application. HTML web forms have this behaviour by default, however in Flex you have to ask for it. i have not yet found a way to do it for the whole form but you simply add a listener to the FlexEvent.ENTER event for each field on the form.
It will look something like this:
<form field>.addEventListener(FlexEvent.ENTER, doLogin);
Where doLogin, obviously, is your login function and <form field> is a field on your form.
October 15th, 2008 at 2:33 am
You can use defaultButton for doing this:
October 21st, 2008 at 8:28 pm
Thanks for that Stan. You are right the defaultButton works a charm.