[eluser]invision[/eluser]
Aaah OK.
Do I have to define it in the
View?
Here's my
Model if it helps:
Code:
function apply($slug=0){
$data['page_data'] = $this->MVacancies->getVacancyItem($slug);
$data['page_data'] or redirect('vacancies/');
$data['title'] = $data['page_data']['title'];
$data['body'] = $data['page_data']['body'];
#Validations
$rules['email'] = "required|valid_email";
$this->validation->set_rules($rules);
#Input and textarea field attributes
$data['email'] = array('name' => 'email', 'id' => 'email');
if ($this->validation->run() == FALSE)
{
$data['main'] = 'vacancies_apply';
$this->load->vars($data);
$this->load->view('template');
}
else
{
$email = $this->input->post('email');
$message = "$email has applied for this job.";
$this->email->from($email, '[email protected]');
$this->email->to('[email protected]');
$this->email->subject('Application for Job #' . $id);
$this->email->message($message);
$this->email->send();
$this->load->view('form_success');
}
}
Am I on the right track from looking at the above code?
Ultimately the email input field will change to a file input field.