Advertisement
anticims19

view_tabel.php

Aug 30th, 2017
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.03 KB | None | 0 0
  1. <div class="row">
  2.             <div class="col s3">
  3.                 <select name="" id="source">
  4.                     <option value="" selected="" disabled="">Select Source</option>
  5.                     <?php foreach ($source as $key):?>
  6.                     <option value="<?php echo $key->source; ?>"><?php echo $key->source; ?></option>
  7.                     <?php endforeach; ?>
  8.                 </select>
  9.             </div>
  10.             <div class="col s3">
  11.                 <select name="" id="scheme">
  12.                     <option value="" selected="" disabled="">Select Scheme</option>
  13.                    
  14.                 </select>
  15.             </div>
  16.           </div>
  17.          
  18. <script>
  19.     $("#source").change(function(){
  20.       var id = $(this).val();
  21.       console.log("klik source");
  22.       console.log(id);
  23.       $.ajax({
  24.         type:'POST',
  25.         data:{key:id},
  26.         url: '<?php echo site_url()."table/get_scheme";?>',
  27.         success: function(data){
  28.           $("#scheme").html(data);
  29.         },error: function(){
  30.           alert('error, Please check your internet connection!');
  31.         }
  32.       });
  33.  
  34.     });
  35. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement