Functions for managing scope for field errors and values.
Functions for managing scope for field errors and values.
(error-for field)
Returns first error message, if any, for field
in the current form scope.
(error-for :email)
Returns first error message, if any, for `field` in the current form scope. ### Example (error-for :email)
(value-for field)
Returns value for `field` in the current form scope. ### Example (value-for :email)
(with-form-scope object values errors & content)
Sets up bindings for form values, errors, translations, and field names.
(with-form-scope :profile {:email "joe@example.com"} {}
(email-field-input :email))
Sets up bindings for form values, errors, translations, and field names. ### Example (with-form-scope :profile {:email "joe@example.com"} {} (email-field-input :email))
(with-nested-form-scope object & content)
Sets up bindings for form values, errors, translations, and field names.
(with-form-scope :profile {} {:address {:street "is required"}}
(with-nested-form-scope :address
(text-field-input :street)))
Sets up bindings for form values, errors, translations, and field names. ### Example (with-form-scope :profile {} {:address {:street "is required"}} (with-nested-form-scope :address (text-field-input :street)))
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close