i have a value in income_date.i want to pass this value to my controller home.php using Ajax

view page

//this is my ajax code block.i have to pass the value from income_date to controller

       function incomeDate(income_date)
        {
           // alert(income_date); 
            $.ajax({
            type: "POST",
            url: "<?php echo base_url();?>home/submit_income",           
            data: {income_date:income_date},
            success: function(res1) 
            {
            }
            });

        }

function call is here

       incomeDate(income_date);

controller home.php

       function submit_income()
       {
           $income_date=$this->input->post('income_date');
      }


Source: ajax

Leave a Reply