Welcome Guest, Not a member yet? Register   Sign In
[solved] set_value with form_input
#3

[eluser]Bianca Migueis[/eluser]
but everything else works perfectly fine with $data[username]... I checked the view source and only thing that is not set as it should is the value...

EDIT: I figured it out. nothing like a good night of sleep to give you some perspective... Apparently the set_value function needs to be run after the $this->form_validation->run() so I just transfered my array to inside the if clause. now it works perfectly with this code:

Code:
public function index()
    {
        $data['loggedin'] = $this->cookie->checkcookie();
        
        
        
        if ($this->form_validation->run('register') == FALSE)
        {
            $data['username'] = array(
                  'name'        => 'username',
                  'id'          => 'username',
                  'value'       => set_value('username'),
                  'maxlength'   => '24',
                  'size'        => '24',
                  'style'       => '',
                );
            $data['password'] = array(
                  'name'        => 'password',
                  'id'          => 'password',
                  'value'       => set_value('password'),
                  'maxlength'   => '24',
                  'size'        => '24',
                  'style'       => '',
                );
            $data['password2'] = array(
                  'name'        => 'password2',
                  'id'          => 'password2',
                  'value'       => set_value('password2'),
                  'maxlength'   => '24',
                  'size'        => '24',
                  'style'       => '',
                );
            $data['first'] = array(
                  'name'        => 'first',
                  'id'          => 'first',
                  'value'       => set_value('first'),
                  'maxlength'   => '24',
                  'size'        => '24',
                  'style'       => '',
                );
            $data['middle'] = array(
                  'name'        => 'middle',
                  'id'          => 'middle',
                  'value'       => set_value('middle'),
                  'maxlength'   => '24',
                  'size'        => '24',
                  'style'       => '',
                );
            $data['last'] = array(
                  'name'        => 'last',
                  'id'          => 'last',
                  'value'       => set_value('last'),
                  'maxlength'   => '24',
                  'size'        => '24',
                  'style'       => '',
                );
            $data['email'] = array(
                  'name'        => 'email',
                  'id'          => 'email',
                  'value'       => set_value('email'),
                  'maxlength'   => '128',
                  'size'        => '50',
                  'style'       => '',
                );
            $data['submit'] = array(
                  'name'        => 'register',
                  'id'          => 'register',
                  'value'       => 'Register',
                  'maxlength'   => '24',
                  'size'        => '24',
                  'style'       => '',
                );
            $this->load->view('register_view', $data);
        }
        else
        {
            $this->updateDB($_POST);
        }
        
    }


Messages In This Thread
[solved] set_value with form_input - by El Forum - 08-15-2011, 11:56 PM
[solved] set_value with form_input - by El Forum - 08-16-2011, 12:28 AM
[solved] set_value with form_input - by El Forum - 08-16-2011, 12:24 PM
[solved] set_value with form_input - by El Forum - 08-16-2011, 01:54 PM



Theme © iAndrew 2016 - Forum software by © MyBB