 
   # -- Render
   render: ->
-    <form data-component-form
-          onSubmit={@onSubmit}
-          onChange={@onChange}>
+    <form data-component-form className={@props.className}
+          onSubmit={@onSubmit} onChange={@onChange}>
       {
         for attribute, index in @props.attributes
           if attribute.type is "submit"
             <Button {...attribute} type="square" ref="submit" onClick={@onSubmit}/>
+          else if attribute.type is "autocomplete"
+            <Autocomplete {...attribute} onChange={@onChange}/>
           else
             <Input {...attribute} />
       }

@todo
###

Style     = require './style/form'
Button    = require "./button"
Input     = require "./input"

module.exports = React.createClass

  # -- States & Properties
  propTypes:
    attributes        : React.PropTypes.array
    storage           : React.PropTypes.bool
    # -- Events
    onSubmit          : React.PropTypes.func
    onError           : React.PropTypes.func

    </form>

  # -- Extends
  storage: (value) ->
    key = "react-toolbox-form-#{@props.storage}"
    if value
      store = {}
      store[attr.ref] = value[attr.ref] for attr in @props.attributes when attr.storage
      window.localStorage.setItem key, JSON.stringify store
    else
      store = JSON.parse window.localStorage.getItem key or {}
      input.value = store?[input.ref] or input.value for input in @props.attributes
      @props.attributes

  getValue: ->
    value = {}
    value[ref] = el.getValue() for ref, el of @refs when el.getValue?
