Welcome Guest, Not a member yet? Register   Sign In
Continuous Loop in form validation
#8

[eluser]Twisted1919[/eluser]
[quote author="yorvik" date="1294419677"]Ok I edited the suggestions, now I am using
Code:
if($this->form_validation->run() == FALSE)
{
redirect('/art_controller/index/', 'refresh');
}

This works but I am still not able the show the message errors on my view. Is there any way I could realise this

My ajax url is:
url: ...art_controller/input/22
My 3rd segment is the ID of the Current record I am updating in the database.[/quote]

As you are doing, you won't get the errors because you refresh the webpage. You can, however, do something like this:
[code]
if($this->form_validation->run() == FALSE)
{
$this->session->set_flashdata('form_error',validation_errors());//set here before redirect
redirect('art_controller/index', 'refresh');
}
// AND in your views, simply do a :
echo $this->session->flashdata('form_error');
[code]

This will work for sure. Your initial idea was the bad one, because you were refreshing the page therefore resetting everything .


Messages In This Thread
Continuous Loop in form validation - by El Forum - 01-06-2011, 05:17 PM
Continuous Loop in form validation - by El Forum - 01-06-2011, 06:23 PM
Continuous Loop in form validation - by El Forum - 01-06-2011, 07:00 PM
Continuous Loop in form validation - by El Forum - 01-06-2011, 07:17 PM
Continuous Loop in form validation - by El Forum - 01-06-2011, 11:26 PM
Continuous Loop in form validation - by El Forum - 01-07-2011, 04:12 AM
Continuous Loop in form validation - by El Forum - 01-07-2011, 05:01 AM
Continuous Loop in form validation - by El Forum - 01-07-2011, 08:50 AM
Continuous Loop in form validation - by El Forum - 01-07-2011, 09:02 AM
Continuous Loop in form validation - by El Forum - 01-07-2011, 11:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB