# vim: ft=org sw=3 ts=3 et
#+TITLE: Mobile Toggle Element
#+STYLE: <LINK href='../stylesheet.css' rel='stylesheet' type='text/css' />
#+AUTHOR: Jesse Gumm (@jessegumm)
#+OPTIONS:   H:2 num:1 toc:1 \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+EMAIL: 
#+TEXT: [[file:../index.org][Getting Started]] | [[file:../api.org][API]] | [[file:../elements.org][*Elements*]] | [[file:../actions.org][Actions]] | [[file:../validators.org][Validators]] | [[file:../handlers.org][Handlers]] | [[file:../config.org][Configuration Options]] | [[file:../about.org][About]]

* Mobile Toggle Element - #mobile_toggle {}

This element produces a [[http://jquerymobile.com/demos/1.1.0/docs/forms/switch/index.html][toggle switch]] formatted by jQuery Mobile.

** Usage

#+BEGIN_SRC erlang
   #mobile_toggle { 
      id=room_lights,
      theme=c,
      on_text="Lights On",
      on_value="on",
      off_text="Lights Off",
      off_value="off,
      selected="off",
      postback=switch_lights
   }
#+END_SRC

** Attributes
 
   + on_text - (/string/) :: The text label of the 'on' position (default "On")

   + off_text - (/string/) :: The text label of the 'off' position (default "Off")

   + on_value - (/string/) :: The value that is submitted with postbacks when in the 'on' position (default "on")

   + off_value - (/string/) :: The value that is submitted with postbacks when in the 'off' position (default "off")

   + selected - (/string/) :: The default selected value (default "off")

   + postback - (/term/) :: If specified, will postback immediately on hitting the toggle

** See Also

   + [[./jquery_mobile.html][jQuery mobile elements]]

   + [[./base.html][base element]]

   + [[./dropdown.html][dropdown element]]
