Fix form macro
This commit is contained in:
parent
f0ce1de929
commit
e3dcb4caad
1 changed files with 7 additions and 4 deletions
|
@ -65,8 +65,10 @@
|
||||||
|
|
||||||
;;; form
|
;;; form
|
||||||
|
|
||||||
(defmacro form ((&optional (attr nil)) &body body)
|
(defmacro form (legend &optional attr &body body)
|
||||||
"Generates HTML form elements using Spinneret library.
|
"Generates HTML form element.
|
||||||
|
|
||||||
|
LEGEND: Add text for <legend>. A short description for forms.
|
||||||
|
|
||||||
ATTR: A list of form attributes like :action, :name and :method. If not provided,
|
ATTR: A list of form attributes like :action, :name and :method. If not provided,
|
||||||
defaults to an empty action, \"html-form\" as name and \"post\" as method.
|
defaults to an empty action, \"html-form\" as name and \"post\" as method.
|
||||||
|
@ -74,10 +76,11 @@ defaults to an empty action, \"html-form\" as name and \"post\" as method.
|
||||||
BODY: The body of the form, which generally includes form elements such as input
|
BODY: The body of the form, which generally includes form elements such as input
|
||||||
fields, checkboxes, radio buttons, etc."
|
fields, checkboxes, radio buttons, etc."
|
||||||
`(spinneret:with-html
|
`(spinneret:with-html
|
||||||
(:form ,@(if (listp attr)
|
(:form ,@(if (not (null attr))
|
||||||
attr
|
attr
|
||||||
(list :action "" :name "html-form" :method "post"))
|
(list :action "" :name "html-form" :method "post"))
|
||||||
(:fieldset ,@body))))
|
(:fieldset (:legend ,legend)
|
||||||
|
,@body))))
|
||||||
|
|
||||||
;;; checkable
|
;;; checkable
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue