0

this is my button HTML view

<button id='<?php echo $row->fldTourRouteID; ?>' data-id='<?php $row->fldProductCabinID; ?>'  data-toggle='modal' data-target='#myModal' class='testbt btn btn-default' type='submit'>ITINERARY</button>

this is my Ajax post

    $(document).ready(function () {

        $(".testbt").click( function () {
                // AlertSave();
                var value = this.id;alert(value);
                var kp = "new";
                var url = "<?php echo base_url(); ?>Moredetails/maldives_resorts_details";alert(url);
                $.ajax({
                    type: "POST",
                    url: "<?php echo base_url('Moredetails/maldives_resorts_details') ?>",
                    data: {value:value},
                    success:function(data){
                        alert(data);
                    }
                });
            }
        );
    });

and controller

   public function maldives_resorts_details($para)
    {
     $itenarytourid=$this->input->post('value');
                $data['get_more_details_route'] = $this->GetData_models->get_more_details_routes_info( $itenarytourid);
    }

I want to post button clicking after, button ID post into my controller

kavinda
  • 77
  • 8
  • There are many duplicates of this, eg https://stackoverflow.com/questions/48239/getting-the-id-of-the-element-that-fired-an-event. Don't forget to use `event.preventDefault()` to stop the normal form submission. If this isn't your question, please edit and describe what is different. – Don't Panic May 10 '20 at 07:32
  • 1
    Does this answer your question? [Getting the ID of the element that fired an event](https://stackoverflow.com/questions/48239/getting-the-id-of-the-element-that-fired-an-event) – Don't Panic May 10 '20 at 07:32

0 Answers0