Created
June 16, 2011 18:05
-
-
Save r-moeritz/1029835 to your computer and use it in GitHub Desktop.
new-game function
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(define-url-fn (new-game) | |
(standard-page (:title "Add a new game") | |
(:script :type "text/javascript" | |
(str (ps | |
(defun validate () | |
(when (= (@ ((@ document get-element-by-id) "name") value) "") | |
(alert "Please enter a name.") | |
(return false)))))) | |
(:h1 "Add a new game to the chart") | |
(:form :action "/game-added.htm" :method "post" | |
:onsubmit (ps-inline (validate)) | |
(:p "What is the name of the game?" (:br) | |
(:input :type "text" | |
:id "name" | |
:name "name" | |
:class "txt")) | |
(:p (:input :type "submit" | |
:value "Add" | |
:class "btn"))) | |
(:p (:a :href "retro-games.htm" "Back to list")))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment