Moderators mark1million Posted May 2, 2016 Moderators Report Posted May 2, 2016 Can anyone point me in the direction of the required fields validation file for registration? I have been hunting but cant find it. Cheers. Quote
web541 Posted May 2, 2016 Report Posted May 2, 2016 I think what you are looking for is in the core/modules/Registration/Registration.php file under the function of VerifyData() as you can see, as an example, if you specify nothing for your first name, it will throw back an error if($this->post->firstname == '') { $error = true; $this->set('firstname_error', true); } else { $this->set('firstname_error', ''); } And as you can see in the ProcessRegistration function, if it sees an error in the VerifyData function, it will throw the template back with an error, otherwise it will continue // Yes, there was an error if(!$this->VerifyData()) { $this->ShowForm(); return; } And if you are looking to edit the error message itself, you can look in the registration_mainform.tpl/.php like this <?php if($firstname_error == true) echo '<p class="error">Please enter your first name</p>'; ?> Quote
Moderators mark1million Posted May 2, 2016 Author Moderators Report Posted May 2, 2016 Lol damn right under my nose. Just couldn't find it for looking lol. I'm fed up of users registering with blank fields for dob and vatsim so I have updated the registration form and the database to move away from custom fields so I can enforce validation. All works fine apart from the validation. Thanks again. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.