Welcome Guest, Not a member yet? Register   Sign In
Logic for multi-step form.. not working.
#11

[eluser]tomclowes[/eluser]
Well.. unless one specifies the name for the rules, it doesnt know what rule to call.

None the less I changed one call to $this->form_validation->run() and it returned true. I.E situation unchanged - seemingly you CANT have multiple calls to named $this->form_validation->run() OR something else is seriously wrong ..

Im going to use your suggestion as to how to achieve this anyway, but id like to find out an answer Smile
Thanks
#12

[eluser]smilie[/eluser]
Well, beats me Sad

Regarding config, do you mean by that validation rules like:
$this->form_validation->set_rules('something','something','required')

Because, as far as I understand it, it goes like:

Code:
$this->load->helper(array('form', 'url'));        
$this->load->library('form_validation');
$this->form_validation->set_rules('something','something','required')
$this->form_validation->run()

# ... some other code ...

$this->form_validation->set_rules('something2','something2','required')
$this->form_validation->run()

Now, first run() will use set_rules above them.
Once second set_rules() kicks in (gets executed) it will 'automagically' be used for the second run(). Of course, as long as both are separated (for example by if statement or such, so that either one or another get's executed).

Could it be, that your form has same parameters for validation? Let's say, form on page 1 has input field named 'test' and form on second page has also field named 'test'? And that that is what 'disturbs' the validation?

Regards,
Smilie
#13

[eluser]tomclowes[/eluser]
Ok. I approached it from your suggestion, and it worked perfectly. So thanks.

What I have is all my validation rules named in form_validation.php in my config folder and then called as $this->form_validation->run('name');

I still do not know why this is not working,and I hate the idea of having a working resolution but not understanding it.

None of the fields are named the same - any help greatly appreciated.

Cheers Smilie for your diligence Smile




Theme © iAndrew 2016 - Forum software by © MyBB