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

I have a small issue.

I am now using form helper and form validation to submit my up and down votes.

But for some reason using the form validation on the down_vote does not submit it keeps on returning false.

I am not sure why form validation does not work with hidden fields.

The var dump is working. form helper is auto loaded.

array (size=1)
 'down_vote' => string '1' (length=1)

Controller Forum

PHP Code:

class Forum extends CI_Controller {

    public function 
__construct() {

    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();


    public function 
down_vote() {

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

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

"Does Not Work";



} else {




PHP Code:
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-12 text-center">
div class="well">

php echo form_open_multipart('forum/up_vote');?>
echo form_hidden('up_vote''1');?>
<button type="submit" style="background-color: transparent; border: none;"><i class="fa fa-angle-up fa-4x"></i></button>
<?php echo form_close();?>

<div class="total"><?php echo $total_votes;?></div>

<?php echo form_open_multipart('forum/down_vote');?>
echo form_hidden('down_vote''1');?>
<button type="submit" style="background-color: transparent; border: none;"><i  class="fa fa-angle-down fa-4x"></i></button>
<?php echo form_close();?>

There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!

Messages In This Thread
Hidden field not been submitted with form validation - by wolfgang1983 - 12-27-2015, 11:48 PM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

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