Button Object

Introduction

The Button Object is an associative array. Part of the Form Object it controls the way a form button is displayed.

Usage

// Get the submit button type.
$type = rgars( $form, 'button/type' );
// Set the submit button text.
$form['button']['text'] = 'the button text';
// Get the previous button type.
$previous_type = rgars( $form, 'lastPageButton/text' );

Properties

All buttons render as <button> elements. Text buttons display their content directly within the element. Image buttons display an <img> element inside the button.

ParamTypeDescription
typestringSpecifies the type of button to be displayed.
Possible values:
text: Displays a button with text content
image: Displays a button with an image
textstringContains the button text displayed inside the button element.
Only applicable when type is set to text.
imageUrlstringContains the URL for the image displayed inside the button.
Only applicable when type is set to image.
conditionalLogicnull|arrayOnly applicable to the submit button.
Controls when the button should be visible based on values selected on the form.
See Conditional Logic Object
locationstringSince v2.6
Only applicable to the submit button.
The button location.
Possible values:
inline: Positions the button on the same row as the last field. Note: The submit button cannot be placed inline with other content on a multi-page form.
bottom: The default position in the form footer.
widthstringSince v2.6
Only applicable to the submit button.
The button width.
Possible values:
auto: the width matches that of the button text.
full: the width expands to fill 100% of the container.
layoutGridColumnSpanintegerSince v2.6
Only applicable to the submit button.
The number of layout grid columns the button spans.
Possible values: 3, 6, 9, or 12