[eluser]Christophe28[/eluser]
Hello,
On the homepage of my website people can enter their email-address and press submit to register. Then they are coming on the actual register page, where the input of the email-address is already set with their giving email-address. But next to the other inputs (like username, password, captcha) I get errors because CodeIgniter thinks the form has already run ...
Does anybody know a work arround for this issue?
Code on homepage:
Code:
<form action="account/register/" method="post">
<input type="text" name="email_input" value="Email ..." id="welcomeEmailInput" /><br />
<input type="submit" value="<?=$lang->register?>" id="welcomeEmailSubmit" />
</form>
Code in account/register controller
Code:
$this->form_validation->set_rules('username', 'Username', 'xss_clean|required|min_length[4]|max_length[45]|callback_user_exists');
$this->form_validation->set_rules('email_input', 'Email Address', 'xss_clean|required|min_length[4]|max_length[45]|valid_email');
// ... along with other form validation rules ...
// If form hasn't run, load empty register view
if($this->form_validation->run() == FALSE) {
// code to be executed when form hasn't run, but CI thinks the form already ran
}
Thank you! :-)
Christophe