doqo89924 2015-05-18 06:58
浏览 61

如何使用jquery模式将表单值发布到控制器函数(codeigniter)?

Actually i am trying to submit form and post values to controller function using jquery modal popup. But it's sending values in URL as parameters. i need to post values because values can be large that can be cause of "the requested url's length exceeds the capacity" error. so, please help me how i can do it?

here is my js funciton.

function hierarchyManagementPrompt(){
 var width = 900;
 var height= 500;
 var resizablez=false;
 var address='top_menu/hierarchy_management_prompt/'; 

 var $form = $('#showBI'),
    $inputs = $form.find("input, select, button, textarea"),
    serializedData = $form.serialize();

           $.modal({
                    url: site_url+address,
                    data: serializedData,
                    title: 'Transfer Detail',
                    width:width,
                    resizable:resizablez,
                    height:height,
                    buttonsAlign : 'left',
                    buttons: {
                            '<img src="../resources/images/icons/fugue   /tick-circle.png">&nbsp;<span id="modelGoBtn">Back To Transfer</span>': function(win) {win.closeModal();}
                    }
                }); 
    warningMsg();}
  • 写回答

1条回答

  • dousilie9522 2015-05-18 07:47
    关注
    var form_data = {
             width : 900,
             height : 500,
             resizablez : false,
             address : 'top_menu/hierarchy_management_prompt/', 
             title: 'Transfer Detail',
             buttonsAlign : 'left',
    };
    

    ajax code change

    $.modal({
         url: site_url+address,
         data: form_data,
         buttons: {
                '<img src="../resources/images/icons/fugue   /tick-circle.png">&nbsp;<span id="modelGoBtn">Back To Transfer</span>': function(win) {win.closeModal();}
                        }
                    }); 
    

    same as array argument passing etc.... to send data by ajax

    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题