# vim: ts=3 sw=3 et ft=org
#+TITLE: Textbox 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]]

* Textbox Element - #textbox {}

  The textbox element produces an HTML textbox.

** Usage

#+BEGIN_SRC erlang
   #textbox { id=textbox1, text="Some text.", next=textbox2 }
#+END_SRC

** Attributes

   + text - (/string/) :: Set the textbox's contents.

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

   + placeholder - (/string/) :: Sets the placeholder text (text that will be
      in the textbox until the user focuses in the textbox). This uses the
      HTML5 placeholder attribute, which is only supported in newer browsers.
      To add support for older-browsers, you will need to link a placeholder
      script in your template. You can do this by adding the following to your
      template inside the =<head>= section after loading jQuery. 

#+BEGIN_SRC html
   <script src='/nitrogen/jquery.placeholder.js' type='text/javascript'></script>
#+END_SRC

   + next - (/atom/) :: 
      If set with a valid control ID, pressing the enter key in the 
      textbox will automatically move focus to the specified control.

   + postback - (/Erlang term/) :: 
      If set, pressing the enter key in the textbox will automatically
      initiate a Nitrogen postback with the supplied term.

   + html\_name - (/string/) :: The name attribute of the textbox.

** See Also

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

   + [[./button.html][button element]]

   + [[./password.html][password element]]

   + [[./textarea.html][textarea element]]

   + [[./checkbox.html][checkbox element]]

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

   + [[./option.html][option element]]

   + [[https://github.com/mathiasbynens/jquery-placeholder][jQuery Placeholder Readme]]

 
