Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Form Questions /

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Validator in form ignores password


Go to End


3 Posts   1197 Views

Avatar
_Vince

Community Member, 165 Posts

9 August 2011 at 1:29pm

Hi, I have a custom form on a webpage, and some fields need to be filled in.

I create the fields, I add them to the fieldset, I add the field names to a RequiredFields, as in

$validator = new RequiredFields('Surname', 'FirstName', 'BBOUserName', 'Password', 'Email');

And if I don't fill in the fields, I get an error message. Fine.

Except that the RequiredFields is taking no notice of the Password field, which is defined as

        $Password = new ConfirmedPasswordField(
                $name = 'Password',
                $title = 'Password*',
                $value = $PasswordVal,
                $maxLength=8,
                false,
                'Please confirm your password'
        );

What am I doing wrong?

Avatar
_Vince

Community Member, 165 Posts

10 August 2011 at 5:11pm

*bounce*

Avatar
_Vince

Community Member, 165 Posts

16 August 2011 at 11:12pm

Any idea of what I am doing wrong or how I can fix the problem?