Welcome Guest, Not a member yet? Register   Sign In
Converting to AJAX
#1

[eluser]HooJee[/eluser]
Hi Guys

I have a form I want to use Ajax to manage my error handling. I am really lost on how to do this as there is little documentation on AJAX/CI. Anyway, below is what I have:

Code:
$this->load->helper(array('form', 'url'));
    
$this->load->library('form_validation', 'ajax');
        
$this->form_validation->set_rules('name', 'Name', 'required|min_length[1]');
$this->form_validation->set_rules('email', 'Email', 'required|valid_email');
$this->form_validation->set_rules('comments', 'Comments', 'required|min_length[5]');
    
if ($this->form_validation->run() == FALSE) {    
    $this->load->view('ajax/contact');
} else {
    $this->load->view('formsuccess');
}

If the user hasn't filled out the form properly then I want to update only the error div tags. What changes do I need to make ?


Messages In This Thread
Converting to AJAX - by El Forum - 07-26-2009, 02:12 PM
Converting to AJAX - by El Forum - 07-26-2009, 02:25 PM
Converting to AJAX - by El Forum - 07-26-2009, 02:32 PM
Converting to AJAX - by El Forum - 07-26-2009, 02:34 PM
Converting to AJAX - by El Forum - 07-26-2009, 03:15 PM
Converting to AJAX - by El Forum - 07-26-2009, 07:48 PM
Converting to AJAX - by El Forum - 07-26-2009, 09:20 PM
Converting to AJAX - by El Forum - 07-26-2009, 09:36 PM



Theme © iAndrew 2016 - Forum software by © MyBB