[eluser]jonnyG[/eluser]
hey there,
I'm just writing a little formular, if something is not completly filled out there should show up a little java alert window...
Controller
Code:
$this->form_validation->set_rules('name', 'Name', 'required');
if ($this->form_validation->run() == FALSE)
{
$alert['bool'] = true;
$alert['message'] = "ooops something missing!";
print_r($alert);
$this->load->view('header');
$this->load->view('pages/req', $alert);
$this->load->view('footer');
}
else
{
$alert['bool'] = true;
$alert['message'] = "Your request was send!";
$this->load->view('header');
$this->load->view('req', $alert);
$this->load->view('footer');
}
View
Code:
<?php
if($bool == true){?>
[removed]
function myFunction()
{
alert(<?=$message?>);
}
[removed]
<?php
}
?>
print_r($alert); --> Array ( [bool] => 1 [message] => ooops something missing! )
any idea where the problem could be?
the [removed] stands for javascript....