Username And Email Login Form Validation Question |
I have one input field called type where the user can enter his/her email or username
Code: <div class="form-group"> On my form validation rules check I have this Code: $this->form_validation->set_rules('type', 'Username Or Email', 'trim|required'); But because the type input can be username or email can not use valid_email I have this Code: $this->form_validation->set_rules('type', 'Username Or Email', 'trim|required|valid_email'); QUESTION: How can I check if the user enters email that it can check is valid_email but if the user enters username will not need to check valid_email do I need to do a separate callback? Code: public function validateForm() {
There's only one rule - please don't tell anyone to go and read the manual. Sometimes the manual just SUCKS!
|
Messages In This Thread |
Username And Email Login Form Validation Question - by wolfgang1983 - 04-12-2017, 08:22 PM
RE: Username And Email Login Form Validation Question - by neuron - 04-12-2017, 10:58 PM
RE: Username And Email Login Form Validation Question - by JayAdra - 04-12-2017, 11:41 PM
RE: Username And Email Login Form Validation Question - by wolfgang1983 - 04-13-2017, 12:04 AM
RE: Username And Email Login Form Validation Question - by Diederik - 04-13-2017, 12:28 AM
RE: Username And Email Login Form Validation Question - by skunkbad - 04-13-2017, 12:48 AM
RE: Username And Email Login Form Validation Question - by Diederik - 04-13-2017, 03:16 AM
|