I need to pass a value to a modal window (fancybox). To do this I created the following code:
$.fancybox.open({
type: 'iframe', // ajax but switched to iframe for testing
href: '<?php echo base_url(); ?>index.php/aggiungiFarmaci_controller',
maxWidth: 800,
maxHeight: 600,
fitToView: false,
autoSize: true,
closeClick: false,
autoCenter: true,
scrolling: 'no',
padding: 0,
ajax: {
type: "POST",
cache: false,
data: $("#formCF").serialize(),
},
helpers: {
overlay: {
closeClick: false,
css: {
'background': 'rgba(150,144,146,.60)'
}
}
}
});
The page I want to open and populate with the value passed by the caller of the modal window has the following code:
public function index() {
$this->load->helper((array('form')));
$this->load->library('form_validation');
$data = array('aic' => $this->input->post('codiceFarmaco'));
$this->load->view('aggiungiFarmaci_view',$data);
}
Unfortunately I can not pass the parameter I wanted (AIC Code) to the modal window that opens without showing it. How can I fix? I think the problem lies in the code that calls fancybox, but I do not know what else to try. Thank you so much for the help