         [:div.col-sm-8.col-md-offset-5
          [button-tool-bar
           [button {:bs-style "success" :on-click save-function} "Save"]
-          [button {:bs-style "danger" :on-click fieldbook-form-cancel } "Cancel"]]] ]]]]]])
+          [button {:bs-style "danger" :on-click fieldbook-form-cancel } "Cancel"]]]
+        ]]]]]])
+
+
 
 (defn fieldbook-add-form-onclick [data-set focus]
-  (if (= nil (fieldbook-form-validator @data-set))
-    (do (reset! data-set (assoc @data-set :villageid (int (.-value (.getElementById js/document "fieldbook-districts")))))
-        (let [onres (fn[json] (accountant/navigate! "/fieldbook"))]
-          (http-post (str serverhost "fieldbooks") onres  (.serialize (Serializer.) (clj->js @data-set)))))
-    (reset! focus "on")))
+  (if (= nil (revenue-form-validator @data-set))
+    (let [onres (fn[json] (accountant/navigate! "/fieldbook"))]
+      (http-post (str serverhost "fieldbooks") onres  (.serialize (Serializer.) (clj->js @data-set)))))
+  (reset! focus "on"))
 
 
 (defn fieldbook-update-form-onclick [data-set focus]
   (if (= nil (fieldbook-form-validator @data-set))
-    (do (reset! data-set (assoc @data-set :villageid (int (.-value (.getElementById js/document "fieldbook-districts")))))
-        (let [onres (fn[data] (accountant/navigate! "/fieldbook"))]
-          (http-put (str serverhost "fieldbooks/" (:id @data-set)) onres (.serialize (Serializer.) (clj->js @data-set)))))
-    (reset! focus "on")))
+    (let [onres (fn[data] (accountant/navigate! "/fieldbook"))]
+      (http-put (str serverhost "fieldbooks/" (:id @data-set)) onres (.serialize (Serializer.) (clj->js @data-set)))))
+  (reset! focus "on"))
 
 
 

(defroute khasragirdwani-add-path "/khasragirdwani/add" []
  (if (nil? (get-value! :user)) (accountant/navigate! "/login")
      (let [onres (fn[json](
                           (set-key-value :villages (getdata json))
                           (set-page! [khasragirdwani-add-template])))]
        (http-get-auth (str serverhost "villages") onres))))

(defroute khasragirdwani-upd-path "/khasragirdwani/update/:id" [id]
  (let [onres (fn[json](
                       (set-key-value :villages (getdata json))
                       (set-page! [khasragirdwani-update-template id
                                   (first (filter (fn[obj]
                                                    (=(.-id obj) (.parseInt js/window id)))
                                                  (get-value! :khasragirdwanis)))])))]
    (http-get-auth (str serverhost "villages") onres)))

(defn khasragirdwani-add [event]
  (accountant/navigate! "/khasragirdwani/add"))

(defn render-khasragirdwani [khasragirdwanis]
  [:div.col-sm-12
   [:div {:class "box"}
    [:div {:class "box-header"}
     [:h3.box-title "List of Khasragirdwani Records"]]
    [:div.box-body
      [:div.form-group
       [:input {:type "button" :value "Add"

  (let [add-data (r/atom {:isactive true})
        focus (r/atom nil)]
    (fn [] [masavi-template
           "Khasra Girdwani Add Form"
           add-data focus
           #(masavi-add-form-onclick add-data focus)])))

(defn masavi-update-template [id dmt]
  (let [update-data (r/atom {:id (int id)
                             :serialnumber (.-serialnumber dmt)
                             :subdivisionid (.-subdivisionid dmt)
                             :villageid (.-villageid dmt)
                             :year (.-year dmt)
                             :racknumber (.-racknumber dmt)
                             :description (.-description dmt)
                             :isactive true})
        focus (r/atom nil)]
    (fn [] [masavi-template
           "masavi Update Form"
           update-data focus
           #(masavi-update-form-onclick update-data focus)])))


(defn masavi-update[id]
