[eluser]DynamiteN[/eluser]
hmmm okey ..
i actually removed this completly
Code:
$this->input->post('submit');
and now the UpdateNews() looks like this
Code:
function UpdateNews() {
if(IS_AJAX){
$nid = $this->uri->segment(4);
$this->form_validation->set_rules('newstitle', 'News Title', 'required|trim');
$this->form_validation->set_rules('newsauthor', 'News Author', 'required|trim');
$this->form_validation->set_rules('newscontent', 'News Content', 'required|trim');
$this->form_validation->set_rules('news_date', 'News Date', 'required');
$newstitle = $this->input->post('newstitle');
$newsauthor = $this->input->post('newsauthor');
$newscontent = $this->input->post('newscontent');
$news_date = $this->input->post('news_date');
$data = array(
'title' => $newstitle,
'content' => $newscontent,
'author' => $newsauthor,
'news_date' => $news_date
);
if($this->form_validation->run() == FALSE) {
echo validation_errors();
}else{
if($this->admin_news_model->UpdateNews($data, $nid)){
echo "News Updated";
}
}
}else{
echo "Direct Access Not allowed";
}
}
when i to submit i actually get "News Updated" from the line that checks to model
BUT nothing gets updated.
I actually think that there is something with the javascript that is messy it doesnt seem to actually send the actual values to the model, thats what i think anyway,
because to the controller the values to come as the validation errors appear if don't fill in a field
adn when it comes to ajax/jquery or whatever it is called my mind draws a complete blank .. :/
P.S Would like to thank you guys for sticking with my problem <3