 
 (defn- get-value
   [event]
-  (.-target.value event))
+  (-> event .-target .-value))
 
 (def form-data (atom {}))
 


(defn head-input
  []
  (let [{:name head-name} @form-data]
    [:input {:type "text"
             :value head-name
             :on-change (fn [ev]
                          (swap! form-data assoc :name (get-value ev)))}]))

(defn submit-button
  [submit-url]
  [:input {:type "button" :value "save" :on-click #(validate-form submit-url)}])

(defn head-form
  ([{:keys [csrf submit-url original-name] :or {original-name ""}}]

      (swap! form-data assoc :original-name original-name
                             :__anti-forgery-token csrf)
      (fn []
        [:form.main
          [:div
            [:fieldset
              [:div
                [:label {:for "head-name"} "Head Name"]
                [head-input]]]
            [submit-button submit-url]]]))))
