You are here

function jquerymobile_api_form_examples in jQuery Mobile module 7.2

Form element options for jQuery Mobile.

You can enable any of these options manually by adding the appropriate data to the '#attributes' array on your form elements. These are simply convenience options. They trigger the exact same effect.

File

./jquerymobile.api.php, line 20
Lists new API functions, hooks and Form API options for jQuery Mobile

Code

function jquerymobile_api_form_examples() {
  $form = array();

  /**
   * Button and Submit Attributes
   *
   * For more details
   * @see http://jquerymobile.com/demos/1.0/docs/buttons/buttons-types.html
   */
  $form['button'] = array(
    '#type' => 'button',
    '#value' => t('Button'),
    // Add rounded corners to your button.
    '#corners' => TRUE,
    // Apply an icon
    // You can see the available list of icons by calling
    // jquerymobile_icon_options()
    '#icon' => 'gear',
    // Icon position
    // You can see the available positisions by calling
    // jquerymobile_icon_position_options()
    '#icon_position' => 'top',
    // Icon shadow.
    '#icon_shadow' => TRUE,
    // Make this button inline with other buttons
    // Works best when buttons are rendered one after the other or within
    // a control group of fieldset.
    '#inline' => FALSE,
    // Add a shadow to the button.
    '#shadow' => FALSE,
    // Set the swatch for this element
    // Can be any letter from a-z (lowercase).
    '#swatch' => 'a',
  );
}