zikula-modules / Formicula

A template-driven form mailer for Zikula

Home Page:https://ziku.la

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

"Match Field" plugin as used in user registration

hvorragend opened this issue · comments

When setting up a form it's often desirable to require users to enter a piece of data twice, the two fields must match to avoid typos. You see this all the time on web forms where something like an email or contact number is very important to get right.

I'd like to be able to make fields like this in Formicula forms, is there a plugin for this?

It's even on the Zikula new user registration form for email, is the Javascript somewhere in the standard Zikula scripts?
Change History
comment:1 Changed 16 months ago by espaan

You can do this with the validation.js options. See http://tetlaw.id.au/view/javascript/really-easy-field-validation
for the options. You must make a validation yourself and include the equatToField in there.

See the example on that page where you have password matching check as below.

Validation.addAllThese('validate-password', 'Your password must be more than 6 characters and not be 'password' or the same as your name', {
minLength : 7,
notOneOf : ['password','PASSWORD','1234567','0123456'],
notEqualToField : 'username'
});

comment:2 Changed 5 months ago by espaan

Priority changed from major to minor
Severity changed from blocker to medium severity
Status set to pending-review

comment:3 Changed 3 months ago by espaan

Milestone changed from 2.2 to 3.0.0

It might make sense to put this in an example form somewhere.

It can be done via the validation. It's not in an example form yet, but that's up to the user to implement. Check out form_3 example form for a validation implemented in the form itself