Gossamer Forum
Home : Products : Gossamer Forum : Discussion :

Validation of additional required signup fields

Quote Reply
Validation of additional required signup fields
Hello,



I'm adding some fields in my signup page and (such as address, phone, etc) and requiring some for singup. I've modified my User.pm as follows:

Code:


else {
my @errors;
if ($GForum::Authenticate::Auth_Error) {
push @errors, $GForum::Authenticate::Auth_Error;
$IN->delete('user_username');
}
if (not length $input->{user_username}) {
push @errors, 'SIGNUP_NO_USERNAME';
}
if (not length $input->{user_first}) {
push @errors, 'SIGNUP_NO_FIRST';
}
if (not length $input->{user_last}) {
push @errors, 'SIGNUP_NO_LAST';
}

And I've also edited my language file for the appropriate error returns. The problem I have is when someone signs up, if they don't enter the default required fields (username, password, email) as well as my new required fields (first name last name) it will return the error in red text about not having the username, password, first name, and last name.

However, if they enter the default required fields i.e. username, password, email, but leave the new required fields (first name, last name) out the error that is returned is :

Code:
A fatal error has occurred:

Column User First Name cannot be left blank.
Column User Last Name cannot be left blank. at GForum::User::signup_submit line 479.

Please enable debugging in setup for more details.

What am I missing?
Subject Author Views Date
Post Validation of additional required signup fields fbm 1155 Sep 29, 2003, 10:09 AM