Welcome Guest, Not a member yet? Register   Sign In
Help with form validation
#3

[eluser]RecoilUK[/eluser]
Hi

Thanks for the reply.

But I found another way ...

Code:
$this->form_validation->set_rules('postcode', 'Postcode', 'required|alpha_numeric_space|min_length[8]|max_length[9]');
  $this->form_validation->set_rules('postcode1', 'Postcode', 'required|alpha_numeric_space|min_length[3]|max_length[4]');
  $this->form_validation->set_rules('postcode2', 'Postcode', 'required|alpha_numeric_space|min_length[3]|max_length[4]');

and then ...

Code:
if(isset($_POST['submit'])) {
   $_POST['postcode'] = $_POST['postcode1'] . ' ' . $_POST['postcode2'];
  }

But you only echo the one error message for postcode. You need the other two rules otherwise the fields don't get re populated.

What do you think?


Messages In This Thread
Help with form validation - by El Forum - 10-09-2012, 07:47 AM
Help with form validation - by El Forum - 10-09-2012, 07:56 AM
Help with form validation - by El Forum - 10-10-2012, 01:08 AM
Help with form validation - by El Forum - 10-12-2012, 02:04 AM
Help with form validation - by El Forum - 10-12-2012, 02:10 AM
Help with form validation - by El Forum - 10-12-2012, 02:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB