[eluser]boltsabre[/eluser]
Quick thought:
1. Get the entire functionality working 100% correct without JS (ie, form submits, inserts data to the DB and redirects to correct controller after the db insert).
2. Then start to implement the JS code incrementally. The JS code above that we talked about ONLY submits the form in the normal "php" way when the user clicks enter. So... you should still see data being written into your DB. Correct, can you see the new data in your DB?
3. If you can see the new data, but the page doesn't change, as you implied in your last post, I imagine that it is because when your form validation passes and you insert your data you are using
Code:
"this->load->view('....')"
Instead of "redirect()". Correct? If so, the reason that you're not seeing any new data on the page (even though it was successfully inserted into your database) is because using the $this->load->view just reloads the same view you had before the DB insert. You need to use "redirect" to force a page refresh (thus a new DB "get all comments" call or whatever you have).
4. Okay... so you don't want this, you want it to dynamically display the new data without a page refresh yes? In which case, this is where you'll have to start using AJAX. I'd look online for some CI/AJAX tutorials and run through them, they'll help you get started.
Let me know if any of the above was incorrect.