reformation.validateform

alert-if-needed

(alert-if-needed opt-map)
Alerts the user by creating a popup containing information regarding which fields are filled in improperly

build-error-message

(build-error-message invalid-labels)
builds an error message off the fields that fail .checkValidity made up of the failed fields labels

check-field-validity

(check-field-validity fields)
returns a vector of the labels of all fields that fail .checkValidity

date?

(date? date)
Returns true if a string is in the expected format of a date which is XX-XX-XXXX or
XX/XX/XXXX

digits?

(digits? s)
Returns true if a string consists only of numerical digits.

email-address?

(email-address? email)
Returns true if the email address is valid, based on RFC 2822. Email
addresses containing quotation marks or square brackets are considered
invalid, as this syntax is not commonly supported in practise. The domain of
the email address is not checked for validity.

get-required-fields

(get-required-fields opt-map)
get all fields labeled as required in the opt-map

phone-number-symbols?

(phone-number-symbols? s)
Returns true if a string consists only of numerical digits, or symbols found in a phone number

phone-number?

(phone-number? num)
checks if a phone number is the correct format, must have 10-12 numbers and can be combinations
of any of the following forms:
123.456.7890
+1 123 456 789
1234567890
1-123-456-7777

present?

(present? x)
Returns false if x is nil or blank, true otherwise.

validate-form

(validate-form)

validate-form-feedback

(validate-form-feedback opt-map)
Validates the form and gives feedback on which fields were invalid. Takes the schema of the application in a vector as an argument, which is the same schema you passed to render-application

zip-code?

(zip-code? zip-code)
Returns true if the input string is of the zipcode format of 00000-0000 or 00000