Getting notified when return is pressed
Unfortunately different browsers handle events in quite a different manner. So
DWRUtil.onReturn patches over the differences. If you want to have a submit button that does the same as pressing return in a form field, then you need to code your application like this:
<input type="text" onkeypress="DWRUtil.onReturn(event, submitFunction)"/> <input type="button" onclick="submitFunction()"/>
You can use either the
onkeypress event or the
onkeydown event; they do roughly the same thing.
This function makes up for the fact that the onSubmit() event only works with
<FORM ...> elements.