    [:label
     [:input {:field :radio :name name :value value}]
     label]])
-(defn input [label type id value]
-  (row label [:input.form-control {:type type :id id :defaultValue value}]))
+(defn input
+  ([label type id value]
+   (row label [:input.form-control {:type type :id id :defaultValue value}]))
+  ([label type id]
+   (input label type id "")))
+
+(defn getinputvalue[id]
+  (.-value (.getElementById js/document id)))
+
+(defn get-documents-formdata []
+  {:documentname (getinputvalue "documentname")
+   :title (getinputvalue "title")
+   :employeename (getinputvalue "employeename")
+   :date (getinputvalue "date")
+   :location (getinputvalue "location")
+   })
+
+
+(defn save [event]
+  (let [onres (fn[data] (set! (.-location js/window) "http://localhost:8193"))]
+    (http-post "http://localhost:8193/documents/add"
+               onres  (JSON/stringify (clj->js (get-documents-formdata))))))
 
 (defn document-template []
   [:div {:id "add" :class "form-group"}
-   [:div#dn (input "Documentname" :text :documentname)]
+   [:div#dn (input "Documentname" :text :documentname )]
    [:div#tl (input "Title" :text :title)]
    [:div#empn (input "EmployeeName" :text :employeename)]
    [:div#dt (input "Date":Date :date)]

    (.setEnabled history true)))

(defn nav! [token]
  (.setToken history token))

(main)

   [:input {:type "button" :value "Save"
            :class "btn btn-primary" :on-click save}]
   ])

(defn get-update-documents-formdata []
  {
   :id (getinputvalue "id")
   :documentname (getinputvalue "upd_documentname")
   :title (getinputvalue "upd_title")
   :employeename (getinputvalue "upd_employeename")
   :date (getinputvalue "upd_date")
   :location (getinputvalue "upd_location")
   })



(defn click-update[id]
  (.assign js/location (str "#/documents/update/" id)))


(defn docupdate [event]
  (let [onres (fn[data]
                (.assign js/location "/"))]
    (http-post "http://localhost:8193/documents/update"
               onres (JSON/stringify (clj->js (get-update-documents-formdata))))))


(defn document-update-template [id dmt]
  [:div.form-group {:id "update" :class "form-group"}
