[eluser]cwpollock[/eluser]
For some reason when I do my validation it is not populating the error message with the field name. So my messages end up looking like this "The field must contain a valid email address." Instead of "The Email field must contain a valid email address".
Any idea why this would be happening?
[eluser]cwpollock[/eluser]
Thank you! This helped me solve the problem. These were being defined in the modules constructor and there were no values being assigned to the field names. I appreciate the assistance.
[eluser]Shahgeb[/eluser]
I want to Know that How i can find that there is duplicte email address exist in db.
plz i cannot understand it.
if a user fillup a signup form. It might be his enterd email address is already in db. i want a code such like that.
help me
best regard
Amjad Farooq
[eluser]gtech[/eluser]
@cwpollock:
no probs, glad it helped.
@amjadfarooq:
I wont write the code for you, but I can point you in the right direction.. you should read and understand CI 'validation' class in the documentation..
once you have done that take a look at the section Callbacks: Your own Validation Functions in the validation documentation.
what you need to do is write a callback function that will do a select on the database using the email entered from the form (this will be passed as a parameter into the callback function).. then if the query returns a result then you know it already exists in the database. If the email exists in the database you call the $this->validation->set_message and return FALSE, otherwise you return TRUE.
hope this helps.
[eluser]Shahgeb[/eluser]
thanks i have made it possible with your guidence thanks again
[eluser]gtech[/eluser]
your welcome.