Welcome Guest, Not a member yet? Register   Sign In
Error message after form validation runs successful
#1

Hi,

is it possible to set an error message AFTER form validation runs successful?
The reason is, i want to include mailchimp and mailchimp blocks email adresses. if so, i want to show an error message.

PHP Code:
if ($this->form_validation->run() === true) {
 
   // connect to mailchimp
 
   // if mailchimp throw an error, show an error message

Reply
#2

Generally, if you want the message to be output by the form_helper's validation_errors() and/or form_error() functions, or via $this->form_validation->error() and/or $this->form_validation->error_string(), you will probably need to create a custom validation rule to run during validation.

Otherwise, you would simply handle the error the same way you handle a validation error. Generally, you would pass the error message through to the view and display it the same way you would a validation error.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB