Welcome Guest, Not a member yet? Register   Sign In
CI Form Help
#1

[eluser]dmisterct[/eluser]
Hey if anyone can help me out with my forms that would be great. I enabled error_logging all the way up to 4 and I don't see any errors and I'm completely clueless why it does not work.

controller/something.php
Code:
class Something extends CI_Controller {
    public function __construct() {
        parent::__construct();
        $this->load->helper('form');
    }

    public function index() {
       $data['stuff'] = 'Content';
       $this->load->view('something', $data);
    }

    public function results() {
       $data['stuff'] = $this->input->post('info');
       $this->load->view('something', $data);
    }
}

views/something.php
Code:
<html>
<head><?=$stuff ?></head>
<body>
<?=form_open('something/results') ?>
<?=form_input('info', 'Info') ?>
<?=form_submit('submit', 'Submit!') ?>
<?=form_close() ?>
<?=$stuff ?>
</body>
</html>

It just hangs there. I'm not sure why but I'm wondering but I didn't include some JQuery code that is on my views page but that shouldn't affect it from working. There are no errors and the last line of my CodeIgniter error logs outputs

DEBUG - 2012-04-21 21:15:28 --> Helper loaded: text_helper
DEBUG - 2012-04-21 21:15:35 --> Final output sent to browser
DEBUG - 2012-04-21 21:15:35 --> Total execution time: .9838

So I'm at a complete loss, the only thing left I can think of is to use AJAX form handling instead of purely CodeIgniter. Am I missing something or do I have to use Jquery to process forms?
#2

[eluser]LifeSteala[/eluser]
Hi - I just tried your code on a fresh install of Code Igniter. Your code worked fine for me. You might need to provide us more code for us to look and debug at.




Theme © iAndrew 2016 - Forum software by © MyBB