Welcome Guest, Not a member yet? Register   Sign In
making a form to work
#1

[eluser]entropy[/eluser]
I have a big problem with making a form work.

I use a controller to handle a registration request. When I strip de controller down to this:
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Register extends CI_Controller {

public function index() {
$this->load->view('top');
$this->load->helper('form');
$this->load->view('end');
}
}

?>
the 'top' and 'end' views are neatly shown. But when I make a start with showing a form:
Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Register extends CI_Controller {

public function index() {
$this->load->view('top');
$this->load->helper('form');
echo form_open('register/confirm');
$data = array(
              'name'        => 'username',
              'id'          => 'username',
              'value'       => '',
              'maxlength'   => '40',
              'size'        => '40'
            );
echo form_input($data);    
$this->load->view('end');
}
}

?>
CI then places the form and input field at the very top of the html, even before the <html> tag.

It seems to me that making a form with the form helper is just impossible. Either that, or else: What am I doing wrong?


Messages In This Thread
making a form to work - by El Forum - 10-17-2012, 09:17 AM
making a form to work - by El Forum - 10-17-2012, 09:26 AM
making a form to work - by El Forum - 10-17-2012, 09:51 AM
making a form to work - by El Forum - 10-17-2012, 04:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB