aries_

view nya

Jul 30th, 2012
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.67 KB | None | 0 0
  1.  <head>
  2.         <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  3.  
  4.        <link rel="stylesheet" href="<?php echo base_url();?>jquery/jquery-ui.css" type="text/css" media="all" />
  5.       <link rel="stylesheet" href="<?php echo base_url();?>jquery/ui.theme.css" type="text/css" media="all" />
  6.       <script src="<?php echo base_url();?>jquery/jquery.min.js" type="text/javascript"></script>
  7.       <script src="<?php echo base_url();?>jquery/jquery-ui.min.js" type="text/javascript"></script>
  8.  
  9.     </head>
  10.     <body>
  11.    <?php echo $this->session->flashdata('msg'); ?>
  12.     <?php echo form_open('insert/input'); ?>
  13. <div id="stream" >
  14.     Stream      : <?php
  15.         echo form_dropdown("stream",$stream,"","id='stream_id'");
  16.     ?><br>
  17. </div>
  18.    <div id="materi">
  19.     Materi      :
  20.  <?php
  21.         echo form_dropdown("materi",array('Pilih materi'=>'Pilih stream Dahulu'),'','disabled');
  22.     ?><br>
  23.    </div>
  24.    
  25.     <?php echo form_submit("Simpan","simpan"); ?>
  26.  <?php echo form_close(); ?>
  27.  <script type="text/javascript">
  28.         $("#stream_id").change(function(){
  29.                 var selectValues = $("#stream_id").val();
  30.                 if (selectValues == 0){
  31.                     var msg = "Materi : <select name=\"materi\" disabled><option value=\"Pilih materi\">Pilih stream Dahulu</option></select>";
  32.                     $('#materi').html(msg);
  33.                 }else{
  34.                     var stream_id = {stream_id:$("#stream_id").val()};
  35.                     $('#materi_id').attr("disabled",true);
  36.                     $.ajax({
  37.                             type: "POST",
  38.                             url : "<?php echo site_url('chain/select_kota')?>",
  39.                             data: stream,
  40.                             success: function(msg){
  41.                                 $('#kota').html(msg);
  42.                             }
  43.                     });
  44.                 }
  45.         });
  46.        </script>
Advertisement
Add Comment
Please, Sign In to add comment