Your question is a little difficult to read, but if I understand correctly, you have problems checking two separate forms from the same controller or problems with errors from different forms using validation_errors() , which afaik prints ALL errors:
Before starting the check, check for a hidden field, a field that is unique to the form, or you can check the value of a specific submit button.
<form> <input type="hidden" name="form1" value="whatever"> <input name="form1_email" /> <input type="submit" value="Submit Form 1" /> </form>
Then you can use any of these methods to check which form was submitted (this example checks if "form1" was submitted):
<?php // Choose one: if ($this->input->post('form1')): // check the hidden input if ($this->input->post('form1_email')): // OR check a unique value if ($this->input->post('submit') == 'Submit Form 1'): // OR check the submit button value if ($this->form_validation->run()): // process form else: // Create a variable with errors assigned to form 1 // Make sure to pass this to your view $data['form1_errors'] = validation_errors(); endif; endif; // Do same for form 2
Then, in your opinion, instead of validation_errors() you should use:
if (isset($form1_errors)) echo $form1_errors;
If this does not help, let me know and clarify your question by posting your code.
Wesley murch
source share