Liking cljdoc? Tell your friends :D

form-validator.core


?show-messagecljs

(?show-message form name)
(?show-message form name messages)
  1. If parameter messages is provided return a message. If message is not supported, then return true.
  2. If messages is not provided return boolean
1. If parameter messages is provided return a message.
If message is not supported, then return true.
2. If messages is not provided return boolean
sourceraw docstring

?spec-problemscljs

(?spec-problems spec value)

Return nil if pass.

Return nil if pass.
sourceraw docstring

confcljs

source

event->names->value!cljs

(event->names->value! form event)

Update input value to names->value and validate. The best with :on-change event.

Update input value to names->value and validate.
The best with :on-change event.
sourceraw docstring

event->show-messagecljs

(event->show-message form event)
source

form-valid?cljs

(form-valid? form)
source

get-messagecljs

(get-message form name messages)
  1. If invalid is a vector find the deepest message.
  2. If invalid is not a vector return as it is.
1. If invalid is a vector find the deepest message.
2. If invalid is not a vector return as it is.
sourceraw docstring

init-formcljs

(init-form form-conf)
source

show-allcljs

(show-all form)

Add all names (inputs) to :names->show

Add all names (inputs) to :names->show
sourceraw docstring

show-if-not-emptycljs

(show-if-not-empty form name)

Add name (input) to :names->show if value is not empty. hint: Add to :names->show has to be done once and it stays forever. Prevent to show errors when user jump between inputs by tab.

Add name (input) to :names->show if value is not empty.
hint: Add to :names->show has to be done once and it stays forever.
Prevent to show errors when user jump between inputs by tab.
sourceraw docstring

spec-validatecljs

(spec-validate form spec name)

Check value by spec. If validate return nil, otherwise return a reason: the :via value of spec problem.

Check value by spec.
If validate return nil, otherwise return a reason: the :via value of spec problem.
sourceraw docstring

validate-formcljs

(validate-form form)
  1. Validate names->value with :spec-form.
  2. Next validate names->value with names->validators. Do not overwrite errors from 1. by 2.
1. Validate names->value with :spec-form.
2. Next validate names->value with names->validators.
Do not overwrite errors from 1. by 2.
sourceraw docstring

validate-form-and-show?cljs

(validate-form-and-show? form)
source

validate-namecljs

(validate-name form name)

Validate name (input) in names->value. Update names->invalid.

Validate name (input) in names->value.
Update names->invalid.
sourceraw docstring

validator->fncljs

(validator->fn form validator)

If spec, transform to fn. Make consistent fn to check values: (fn [name] ...) return reason of fail or nil

If spec, transform to fn.
Make consistent fn to check values:
(fn [name] ...) return reason of fail or nil
sourceraw docstring

validators->some-validatorscljs

(validators->some-validators form names->validators)

convert validators {:name [::spec f ...]} into {:name some-validator} which check all validators unless one of them fail.

convert validators {:name [::spec f ...]} into {:name some-validator} which check all validators unless one of them fail.
sourceraw docstring

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

× close