• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Hidden field not been submitted with form validation

#2
You could try the following to debug your problem:
PHP Code:
<?php

class Forum extends CI_Controller {

 
   public function __construct() {
 
       parent::__construct();
 
       $this->load->model('model_forum');
 
       $this->load->library('form_validation');
 
   }

 
   public function index() {
 
       $data['forum_user_total_votes'] = 'Your Rep '  $this->model_forum->get_forum_user_reputation();
 
       $data['total_votes'] = $this->model_forum->get_forum_question_reputation();

 
       $this->load->view('common/header');
 
       $this->load->view('forum/forum_question_demo'$data);
 
       $this->load->view('common/footer');
 
   }

 
   public function down_vote() {
 
       

        $this
->form_validation->set_rules('down_vote''Down Vote');

 
       if ($this->form_validation->run() == FALSE) {

 
           echo "Does Not Work";

 
           var_dump($_POST);

 
           // This should give you details on why the form was rejected:
 
           var_dump(validation_errors());

 
           //redirect('forum');

 
       } else {

 
           echo $this->input->post('down_vote');

 
           $this->model_forum->update_forum_question_down_vote();
 
           $this->model_forum->update_forum_user_reputation_down_vote();
 
               
            redirect
('forum');
 
       }
 
   }

Reply


Messages In This Thread
RE: Hidden field not been submitted with form validation - by Diederik - 12-28-2015, 12:04 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.