简体   繁体   中英

How to POST form values to controller function(codeigniter) using jquery modal?

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();}
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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM