skip to Main Content

How to use AJAX for different functions when more buttons included in the form – Jquery

I have a model as below in PHP. <div id="Modal" class="modal fade"> <div class="modal-dialog"> <div class="modal-content"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal">&times;</button> <h4 class="modal-title" >Block</h4> </div> <div class="modal-body"> <form method="post" id="block_form"> <label>Number</label> <input type="text" name="num_block" id="num_block" class="form-control" readonly/> <br />…

VIEW QUESTION

How to send php variable to AJAX – Jquery

I need to retrieve session variable data inside an ajax call. Here is my try. $('#update').click(function(){ var number = $('#num').val(); var curuser = <?php echo $_SESSION['userName'];?> if( number != '' && number.length==9 ) { $.ajax({ data:{number:number}, success:function(data){ $('#number_add').val(number); $('#new_data_Modal').modal('show'); }…

VIEW QUESTION
Back To Top
Search