 ;; -------------------------
 ;; Components
 
-(defn defn-form-content []
+(defn defn-form-content [app-atom]
   [:form {:class "defnForm"}
    [:div {:class "fieldsWrap"}
     [:input {:type "text"
              :class "authorInput"
-             :placeholder "Your Name (Optional)"}]
+             :placeholder "Your Name (Optional)"
+             :on-change (fn [evt]
+                          (swap! app-atom assoc :author evt.target.value))}]
     [:a {:class "button formToggle"} "Add Another Author's Definition"]
     [:br]
     [:input {:type "email"
              :class "emailInput"
-             :placeholder "Enter Your Email"}]
+             :placeholder "Enter Your Email"
+             :on-change (fn [evt]
+                          (swap! app-atom assoc :email evt.target.value))}]
     [:input {:type "email"
              :class "emailConfirm"
              :placeholder "Enter Your Email"}]
     [:span {:class "emailIsConfirmed no"}]
     [:textarea {:class "defnInput twelve columns"
-                :placeholder "Please compose your definition here..."}]
+                :placeholder "Please compose your definition here..."
+                :on-change (fn [evt]
+                            (swap! app-atom assoc :definition evt.target.value))}]
     [:div {:class "btnWrap"}
-     [:button {:class "button-primary defnSubmit"} "Submit"]]]])
-
-(defn defn-form []
-  [defn-form-content])
-
-(defn definition [defn-atom]
-  (fn [defn-atom]
-    (if-not (= (get @defn-atom :text) "")
+     [:button {:class "button-primary defnSubmit"
+               :on-click (fn [evt]
+                          (.preventDefault evt)
+                          (js/console.log "click"))} "Submit"]]]])
+
+(defn defn-form [app-atom]
+  [defn-form-content app-atom])
+
+(defn definition [app-atom]
+  (fn [app-atom]
+    (if-not (= (get @app-atom :text) "")
       [:section {:class "row"}
-       [:p {:class "ten columns"} (get @defn-atom :text)
-        [:span {:class "author"}" -- " (get @defn-atom :author)]]])))
+       [:p {:class "ten columns"} (get @app-atom :text)
+        [:span {:class "author"}" -- " (get @app-atom :author)]]])))
 
 (defn footer []
   [:footer

         (fn [result]
          (let [new-val {:text (.get result "definition")
                         :author (.get result "author")}]
            (reset! defn-atom new-val)))
        :error #(js/console.log %2)}))

(defn get-rand-defn []

    (get-rand-defn)
    [:div {:class "container home"}
     [:header [:h2 {:class "title"} "What is History?"]]
     [definition app-atom]
     [:a {:href "/defineit"} "Contribute Your Own Definition"]
     [footer]]))

(defn defineit-page []
  (parse-init)
  (def usr-promise (save-anonymous-user))
  (.then usr-promise (fn [usr]
                       (.set usr "ip" (js/getIP))
                       (.save usr)))
  (fn []
    [:div {:class "container defineit"}
     [:header [:h2 {:class "title"} "What is History?"]]
