-
1. Re: How to set default button when press "Enter"
Dan Bracuk Feb 2, 2012 2:55 AM (in response to Phinehas1234)What does the other button do?
-
2. Re: How to set default button when press "Enter"
Phinehas1234 Feb 2, 2012 7:52 AM (in response to Dan Bracuk)The new button is used to call the cfc for opening a new sub-window. After some data selection, it sets the result to the form field. Therefore, the button is just set as a normal button. No Submit or Reset will be performed by clicking this button.
-
3. Re: How to set default button when press "Enter"
Dan Bracuk Feb 2, 2012 8:26 AM (in response to Phinehas1234)At first I thought the order of the form controls might matter. When I run this code:
<cfdump var="#GetTickCount()#">
<form action="TestCfgrid.cfm" method="post">
<input name="x" type="text" />
<input type="button" value="x" />
<input type="submit" /></form>
While I am in the text box, if I press the enter key the form submits. I originally tried it with the submit and button inputs in the opposite order.
Note that the enter button will not submit the form if you are in a select control (aka dropdown) or a textarea or if your focus is not on a form element. That's the default behaviour. If you want to override that, you'll have to write some javascript.

