Welcome Guest, Not a member yet? Register   Sign In
Java Popup Window ain't working in php code
#1

[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....


Messages In This Thread
Java Popup Window ain't working in php code - by El Forum - 07-12-2012, 06:40 AM
Java Popup Window ain't working in php code - by El Forum - 07-12-2012, 06:56 AM
Java Popup Window ain't working in php code - by El Forum - 07-12-2012, 07:13 AM
Java Popup Window ain't working in php code - by El Forum - 07-12-2012, 07:39 AM
Java Popup Window ain't working in php code - by El Forum - 07-12-2012, 07:47 AM
Java Popup Window ain't working in php code - by El Forum - 07-12-2012, 07:58 AM
Java Popup Window ain't working in php code - by El Forum - 07-12-2012, 11:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB