用php将数据发送到FancyBox
我需要向模式窗口fancybox传递一个值。为此,我创建了以下代码:用php将数据发送到FancyBox,php,html,codeigniter,modal-dialog,fancybox,Php,Html,Codeigniter,Modal Dialog,Fancybox,我需要向模式窗口fancybox传递一个值。为此,我创建了以下代码: $.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:
$.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)'
}
}
}
});
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);
}
不幸的是,我无法将我想要的AIC代码参数传递到打开时不显示的模式窗口。我该怎么修理?我认为问题在于调用fancybox的代码,但我不知道还有什么可以尝试。非常感谢您的帮助为什么不换个方向试试?首先进行ajax调用,并使用返回的响应从ajax的成功中调用fancybox。你能给我一个具体的例子吗?首先谢谢一个问题:选择器formCF在哪里?在父页面中还是在ajaxed页面中?如果在父页面中,我假设您可能希望在表单提交后传递数据,不是吗?Traduzione ajax代码在发生我在这里没有显示的事件时执行。我想将数据发送到我在fancybox中打开的页面,请帮助我:您没有回答我的问题,选择器formCF在哪里?所以我不想发布一个猜测性的答案