For putting Validation checks using Clojure code, clojure noir library checks are used.
One needs to first create a form page using basic html for placing the checks.As an Example here, I am using a registration page text boxes to put the validation checks over the required fields.
Then we move ahead by creating a register.clj file where all validations are defined under the namespace definition:
Next is to create the route that defines the register function which is called when the register page is rendered.
the above route calls the following function:
where, [id] for any number of arguments passed, (layout/render) renders with that html page where validations are required to be placed, :id-error/email-error are variables placed in the html form that will define the error block, (vali/on-error) denotes noir validation structure.
Next step is to define the errors and put checks over the required fields i.e; defining the errors for above created check blocks.