Reagent-Forms Switches Displayed as Text Fields

I am trying to display a group of radio buttons in a reagent / cljs application. I followed the same process from http://yogthos.github.io/reagent-forms-example.html , but the toggle buttons I show are rendered as textbox input fields.

(def ^:private options (atom nil))

(defn set-options []
(reset! options
      [{:name "label name"}
       {:name "label name"}
       {:name "label name"}])) 


(defn set-radio-buttons []
 (set-options)
   (for [option @options]
      [:div.radio
        [:label
          [:input {:field :radio}]
             (option :name)]]))



  (defn response-box []
    [:div#response
       (set-radio-buttons)])

      

Then I put the response block in the ui layer of the application.

thank

+3


source to share


1 answer


The field is not a valid attribute on the input element.

[:input {:field :radio}]
         (option :name)]]))

      



Probably,

[:input {:type :radio}]
         (option :name)]]))

      

+4


source







All Articles