Default buttons

Is it possible to define a button as the “default”, the one which will be acted on when the user clicks the Enter or Return keys?

See open_splash form of crm solution. The form has a onShow method named onShow that sets the focus to the continueButton. The button has a onAction method named closeSplash.

So by giving focus to the button you can have its method performed by the onAction property. In this case by clicking the button, hitting the Enter key or the Return key.

This works fine on Windows. If my memory serves me right there may be issues with it on the Mac.

Dean

Westy:
See open_splash form of crm solution. The form has a onShow method named onShow that sets the focus to the continueButton. The button has a onAction method named closeSplash.

So by giving focus to the button you can have its method performed by the onAction property. In this case by clicking the button, hitting the Enter key or the Return key.

This works fine on Windows. If my memory serves me right there may be issues with it on the Mac.

Dean

Thanks, I’ll give that a try on both platforms.

Question: is there a visual tool or convention for displaying the default button? Better yet, can the default button be highlighted in the style of the current platform?

Westy:
See open_splash form of crm solution. The form has a onShow method named onShow that sets the focus to the continueButton. The button has a onAction method named closeSplash.

So by giving focus to the button you can have its method performed by the onAction property. In this case by clicking the button, hitting the Enter key or the Return key.

This works fine on Windows. If my memory serves me right there may be issues with it on the Mac.

Dean

Hi Westy

The CRM splash form has a very simple onShow script – elements.continueButton.requestFocus(); That’s it. The Continue button has an onAction method that consists of application.closeFormDialog();

Definitely does NOT work on the Mac. I don’t have CRM installed on my PC, so not tested.

I created a new form on the PC and did exactly the same setup. Responds to a mouse click but not to the Enter or Return key.

Anyone else have thoughts on this?