   onChange: (event) ->
     is_valid = true
     value = @getValue()
-    for attr in @props.attributes when attr.required and value[attr.ref]?.trim() is ""
+    for attr in @state.attributes when attr.required and value[attr.ref]?.trim() is ""
       is_valid = false
       @refs[attr.ref].setError? "Required field"
       break

    <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"

@todo
###

require "./style"
Autocomplete  = require "../autocomplete"
Button        = require "../button"
Input         = require "../input"
