• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Error message after form validation runs successful


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


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.

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.