                         :value (@data-set id)
                         :placeholder placeholder
                         :on-change #(swap! data-set assoc id (-> % .-target .-value))
-                        :on-blur  #(reset! in-focus "on")
+                        ;; :on-blur  #(reset! in-focus "on")
                         } [datalist ]])
 
 (defn form-input-combo [id label data-set focus]

                        :on-blur  #(reset! in-focus "on")
                        }])


(defn login-input-element [id label span-class ttype data-set placeholder focus]
  (let [input-focus (r/atom nil)]
    (fn []
      [:div.form-group
       [:div.row
        [:div.col-sm-12
         [:label label]
         [:div.input-group.col-sm-10
          [:span {:class span-class}]
          [input-element id ttype data-set placeholder input-focus]]
         (if (or @input-focus @focus)
           (if (= nil (login-validator @data-set))
             [:div]
             [:div {:style  {:color "red"}} [:b (str (first ((login-validator @data-set) id)))]])
           [:div])]]])))


(defn submit-login [data-set focus]
  (if (= nil (login-validator @data-set))

                      ;;(js/console.log (.-_2 (getdata json)))
                      (reset-login-page)
                      (secretary/dispatch! "/"))))]
      (http-post (str serverhost "login") onresp (.serialize (Serializer.) (clj->js @data-set ))))
    (reset! focus "on")))

(defn submit-button [data-set focus]
  [:div.row
   [:div.col-md-4
    [:button {:class "btn btn-primary btn-block btn-flat" :on-click #(submit-login data-set focus)} "Sign In" ]]])

(defn login []
  (let [my-data (r/atom  {})
        focus (r/atom nil)]
    (fn []
      [:div.hold-transition.login-page {:style {:width "100%" :height "100%"}}
       [:div.login-box
        [:div.login-logo
         [:b "Log-in"]]
        [:div.login-box-body
         [:p.login-box-msg "Sign in to start your session"]
         [login-input :username "glyphicon glyphicon-envelope form-control-feedback" "email" my-data "Email" focus]
         [login-input :password "glyphicon glyphicon-lock form-control-feedback" "password" my-data "password" focus]
         [submit-button my-data focus ]]]])))


;; ====================================================================================================
;; end of login-form
