fixed bugs in create-form-element

This commit is contained in:
ormf 2023-07-23 14:07:30 +02:00
parent 58823eae3d
commit fc07a77b10

View file

@ -222,20 +222,15 @@ attribute/value pairs in the form attr= 'value'"))
(html-id nil) (html-id nil)
(auto-place t)) (auto-place t))
(declare (ignorable name)) (declare (ignorable name))
(dolist (key '(name class style hidden html-id auto-place)) (when class (setf (getf args :class) (format nil "~(~A~)" (escape-string class :html t))))
(when (or hidden style)
(setf (getf args :style)
(format nil "~@[~a~]~@[~a~]" (when hidden "visibility:hidden;") style)))
(dolist (key '(:name :html-id :auto-place))
(remf args key)) (remf args key))
(let* ( (let* ((element (create-child
(element (create-child obj (format nil "<input type='~A' ~{~(~A~)= '~A'~^ ~}/>"
obj (format nil "<input type='~A'~@[~A~]~@[~A~]~{~(~A~)= '~A'~^ ~}/>" (escape-string element-type :html t) args)
(escape-string element-type :html t)
(when class
(format nil " class='~A'"
(escape-string class :html t)))
(when (or hidden style)
(format nil " style='~@[~a~]~@[~a~]'"
(when hidden "visibility:hidden;")
style))
args)
:clog-type 'clog-form-element :clog-type 'clog-form-element
:html-id html-id :html-id html-id
:auto-place auto-place))) :auto-place auto-place)))
@ -243,6 +238,8 @@ attribute/value pairs in the form attr= 'value'"))
(label-for label element)) (label-for label element))
element)) element))
(escape-string :vslider :html t)
;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;
;; autocomplete ;; ;; autocomplete ;;
;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;