I have a form that kicks off a lengthy process. I have it set up with OK, Cancel, and Default buttons. I implemented my own "Default" button so the button specification is: '(OKCancel (Defaults "AFDefCallBack(hiGetCurrentForm())")
Because the process is lengthy and it is easy for a user to hit carriage return thinking that he is moving on to the next field. Is there a way to disable the automatic "OK" response for carriage return so that they can finish filling out the form rather than kicking off the process?
Actually carriage return does not do an automatic "OK" response; in fact it triggers the "default" button for the form - i.e. the one in Red - the one that is first. So for example, if I define the button layout differently, I can get a different button to fire - one different from the OK button:
hiCreateAppForm(?name 'fred ?fields list(hiCreateStringField(?name 'jim)) ?callback "println(1234)" ?buttonLayout '(Empty (Defaults "println(5678)") (OK "hiFormClose(hiGetCurrentForm())") (Cancel "hiFormCancel(hiGetCurrentForm())")))hiDisplayForm(fred)
Of course, this example is silly - but you'll see that carriage return triggers the "Defaults" button rather than "OK" now. You could make that first button do something non-time consuming but still useful.
OK. I had thought of doing something like that but if I had missed a form feature that disables carriage return response I wanted to know about it. Your suggestion is good. Thanks.