Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type="text/javascript" src="<?php echo base_url('assets/bootstrap/jquery.min.js') ?>"></script>
- <script type="text/javascript">
- $(function(){
- $.ajaxSetup({
- type:"POST",
- url: "<?php echo base_url('index.php/select/ambil_data') ?>",
- cache: false,
- });
- $("#provinsi").change(function(){
- var value=$(this).val();
- if(value>0){
- $.ajax({
- data:{modul:'kabupaten',id:value},
- success: function(respond){
- $("#kab").html(respond);
- }
- })
- }
- });
- $("#kab").change(function(){
- var value=$(this).val();
- if(value>0){
- $.ajax({
- data:{modul:'kecamatan',id:value},
- success: function(respond){
- $("#kec").html(respond);
- }
- })
- }
- })
- $("#kec").change(function(){
- var value=$(this).val();
- if(value>0){
- $.ajax({
- data:{modul:'kelurahan',id:value},
- success: function(respond){
- $("#desa").html(respond);
- }
- })
- }
- })
- $("#fakultas").change(function(){
- var value=$(this).val();
- if(value>0){
- $.ajax({
- data:{modul:'jurusan',id:value},
- success: function(respond){
- $("#jurusan").html(respond);
- }
- })
- }
- });
- $(".flat").click(function () {
- var value=$(this).val();
- if(value=value.checked){
- $.ajax({
- data:{modul:'kamar_akhwat',id:value},
- success: function(respond){
- $("#kamar").html(respond);
- }
- })
- }
- });
- })
- </script>
- <script type="text/javascript">
- function check1() {
- var x=document.getElementById("j_kI");
- var kamar=document.getElementById("kamar");
- if(x=x.checked){
- alert("Tes");
- }
- }
- </script>
- <form action="<?php echo $action; ?>" method="post" id="demo-form2" data-parsley-validate="" class="form-horizontal form-label-left" novalidate="">
- <div class="form-group">
- <label class="control-label col-md-3 col-sm-3 col-xs-12">Jenis Kelamin
- </label>
- <div class="col-md-6 col-sm-6 col-xs-12">
- Laki-laki: <input id="j_kI" type="radio" name="j_k" value="j_kI" />
- Perempuan: <input type="radio" name="j_k" id="j_kA" value="j_k" />
- </div>
- </div>
- <div class="form-group">
- <label class="control-label col-md-3 col-sm-3 col-xs-12" for="varchar">Kamar <?php echo form_error('kamar') ?></label>
- <div class="col-md-6 col-sm-6 col-xs-12">
- <select id="kamar" class="form-control" name="kamar">
- <option value='0'>--pilih--</option>
- </select>
- </div>
- </div>
- </form>
Add Comment
Please, Sign In to add comment