Name: defaultButton

Type: property

Syntax: get the defaultButton of <card>

Summary:
Reports the long <ID> of the <current card|current card's> default
<button>. 

Associations: card

Introduced: 1.0

OS: mac, windows, linux, ios, android

Platforms: desktop, server, mobile

Example:
send mouseUp to the defaultButton of this card

Value:
The <defaultButton> of a <card> is the long <ID> <property> of a
<button>. This property is read-only and cannot be set.

Description:
Use the <defaultButton> <property> to find out which <button> on a
<card> is designated as the <button> to be clicked when the user presses
the Return or Enter key.

The <defaultButton> <property> <return|returns> the long <ID> of the
<button> whose <default> <property> is set to true.

When the user presses Enter or Return and there is no active control,
LiveCode sends a mouseUp <message> to the <defaultButton>. (If the
<card> contains an editable <field>, <handle> the <returnInField> and
<enterInField> messages to ensure that the default <button> is
activated.) 

If more than one button's <default> is true, the <defaultButton>
<property> reports the <ID> of the <button> whose <default> <property>
was set to true most recently. This <property> reports empty if there is
no default <button>.

References: property (glossary), current card (glossary),
handle (glossary), return (glossary), message (glossary), card (glossary),
field (glossary), default (keyword), card (keyword), button (keyword),
returnInField (message), enterInField (message), default (property),
ID (property)

Tags: ui

