0

//how to get a value in php variable instead of input type from script

"href="#mymodal" data-target="#myModal" > $order_id ";?>

//script for getting a value after clicking on a id

<script>
 $(document).ready(function(){
       $("a[rel=dialog]").click(function(){
get this var id on php variable         
   var id =$(this).attr("data-id");
            $('#products_id_textbox').val(id);
            console.log("Order id-"+id);
       });  


    });
</script>

//mymodal box displaying a value-
×

//able to get the value in  input type
<input type="text" id="products_id_textbox"></input>
<?php
//get the value here instead of input type in php variable
?>    
        </div>

        <td>Passenger Name </td>
        <td>Mobile No</td>
    </tr>


        <tr>


        </tr>

</table>
</div>
<div class="modal-footer">
    <button type="button" class="btn btn-default" data-dismiss="modal">Close</button></div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div>

0 Answers0