Liking cljdoc? Tell your friends :D

clj-simple-form.input

Functions for generating input components with labels and input elements.

Options for inputs

  • :error: Error message for the field. Defaults to error for field in current scope..
  • :hint: Hint for the field. Defaults to nil.
  • :input-html: HTML attributes for the input element. Defaults to {}.
  • :label: Label text. Defaults to translation.
  • :label-html: HTML attributes for the label element. Defaults to {}.
  • :value: Value for the field. Defaults to value for field in current scope.
  • :wrapper-html: HTML attributes for the wrapper element. Defaults to {}.
Functions for generating input components with labels and input elements.

### Options for inputs

* `:error`: Error message for the field. Defaults to error for field in
  current scope..
* `:hint`: Hint for the field. Defaults to nil.
* `:input-html`: HTML attributes for the input element. Defaults to `{}`.
* `:label`: Label text. Defaults to translation.
* `:label-html`: HTML attributes for the label element. Defaults to `{}`.
* `:value`: Value for the field. Defaults to value for field in current scope.
* `:wrapper-html`: HTML attributes for the wrapper element. Defaults to `{}`.
raw docstring

check-box-group-inputclj

(check-box-group-input field options)
(check-box-group-input field options args)

Returns a group of checkboxes inside a labeled wrapper.

Example

(check-box-group-input :hobbies [["webdev" "Web Development"]
                                 ["spelunking" "Spelunking"]])
Returns a group of checkboxes inside a labeled wrapper.

### Example

    (check-box-group-input :hobbies [["webdev" "Web Development"]
                                     ["spelunking" "Spelunking"]])
raw docstring

check-box-inputclj

(check-box-input field)
(check-box-input field args)

Returns a check box inside a labeled wrapper.

Example

(check-box-input :privacy-policy {:error "Must be accepted"})
Returns a check box inside a labeled wrapper.

### Example

    (check-box-input :privacy-policy {:error "Must be accepted"})
raw docstring

(drop-down-input field options)
(drop-down-input field options args)

Returns a drop down inside a labeled wrapper.

Example

(drop-down-input :language ["Finnish" "English"]
                 {:value "Finnish"})
Returns a drop down inside a labeled wrapper.

### Example

    (drop-down-input :language ["Finnish" "English"]
                     {:value "Finnish"})
raw docstring

email-field-inputclj

(email-field-input field)
(email-field-input field args)

Returns an email field inside a labeled wrapper.

Example

(email-field-input :email {:label "Username"})
Returns an email field inside a labeled wrapper.

### Example

    (email-field-input :email {:label "Username"})
raw docstring

file-upload-inputclj

(file-upload-input field)
(file-upload-input field args)

Returns a file upload field inside a labeled wrapper.

Example

(file-upload-input :avatar {:input-html {:data-max-size "2M"}})
Returns a file upload field inside a labeled wrapper.

### Example

    (file-upload-input :avatar {:input-html {:data-max-size "2M"}})
raw docstring

inputclj

(input field)
(input field input-or-args & inputs)

Returns the input element(s) inside a labeled wrapper. Use for creating your own input functions.

Example

(defn uneditable-input [field {:keys [value] :as args}]
  (input field args
         (str "<span class=\"uneditable-input\">"
              value "</span>")))
Returns the input element(s) inside a labeled wrapper. Use for creating your
own input functions.

### Example

    (defn uneditable-input [field {:keys [value] :as args}]
      (input field args
             (str "<span class=\"uneditable-input\">"
                  value "</span>")))
raw docstring

password-field-inputclj

(password-field-input field)
(password-field-input field args)

Returns a password field inside a labeled wrapper.

Example

(password-field-input :password {:input-html {:class "password"}})
Returns a password field inside a labeled wrapper.

### Example

    (password-field-input :password {:input-html {:class "password"}})
raw docstring

radio-button-group-inputclj

(radio-button-group-input field options)
(radio-button-group-input field options args)

Returns a group of radio buttons inside a labeled wrapper.

Example

(radio-button-group-input :language ["Finnish" "English"])
Returns a group of radio buttons inside a labeled wrapper.

### Example

    (radio-button-group-input :language ["Finnish" "English"])
raw docstring

text-area-inputclj

(text-area-input field)
(text-area-input field args)

Returns a text area inside a labeled wrapper.

Example

(text-area-input :bio {:hint "Tell people about your background."})
Returns a text area inside a labeled wrapper.

### Example

    (text-area-input :bio {:hint "Tell people about your background."})
raw docstring

text-field-inputclj

(text-field-input field)
(text-field-input field args)

Returns a text field inside a labeled wrapper.

Example

(text-field-input :name {:input-html {:placeholder "First :Last"}})
Returns a text field inside a labeled wrapper.

### Example

    (text-field-input :name {:input-html {:placeholder "First :Last"}})
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close