         [:div.input-4a3e3
           [:label.label-66a3b "MC password:"]
           [:input#password.input-48f1f {:type "password"}]]
-        [:button#submit.red-btn-2c9ab "OK"]]]])
+        [:button#submitPasswordBtn.red-btn-2c9ab "OK"]]]])
+
+(defn- click-login-as-mc [e]
+  (.preventDefault e)
+  (.emit @socket "request-mc" (.val ($ "#password"))))
 
 (defn on-grant-mc
   "Callback for handling the MC access grant."


(def $ js/$)

;;------------------------------------------------------------
;; Stop Game page
;;------------------------------------------------------------

  (.html ($ "#main-container") (password-html))

  ; Request access as MC when user submits password.
  (.click ($ "#submitPasswordBtn") click-login-as-mc)

  ; Render either the stop page or the start page
  ; when access as MC is granted.
  (.on @socket "grant-mc" on-grant-mc)

  ; Put focus on the password field.
  (.focus (by-id "password")))

;;------------------------------------------------------------
;; Main page intializer.
