# vim: sw=3 ts=3 ft=org

#+TITLE: Button Element Element
#+STYLE: <LINK href='../stylesheet.css' rel='stylesheet' type='text/css' />
#+AUTHOR: Rusty Klophaus (@rustyio)
#+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]]

* Button Element - #button {}

  The button element produces an HTML button. When clicked,
  the button will cause a Nitrogen postback.

** Usage

#+BEGIN_SRC erlang
   #button { text="Go!", postback={click, goButton} }
#+END_SRC

** Attributes

   + text - (/string/) :: The button's title.

   + html\_encode - (/boolean/) :: Set to true to safely html-encode the text.

   + postback - (/Erlang term/) :: Clicking on the button will initiate a Nitrogen postback with the supplied term.

   + click - (/Action/ or /List of Actions/) :: Wires the selected actons to the \"click\" events.  Due to the commonality of binding actions to the click event, this is merely a shortcut for

#+BEGIN_SRC ERLANG
   #button { text="Do Something", actions=[
      #event{type=click,actions=ListOfActions}
   ]}
#+END_SRC

** See Also

   + [[./base.html][Base]]

   + [[./link.html][Link]]

   + [[./textbox.html][Textbox]]

   + [[./password.html][Password]]

   + [[./textarea.html][Textarea]]

   + [[./checkbox.html][Checkbox]]

   + [[./dropdown.html][Dropdown]]

   + [[./option.html][Dropdown Option]]

     
