sebuahhobi

view chained

Aug 18th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.58 KB | None | 0 0
  1. <script type="text/javascript" src="<?php echo base_url('assets/bootstrap/jquery.min.js') ?>"></script>
  2.  
  3. <script type="text/javascript">
  4.  
  5. $(function(){
  6.  
  7. $.ajaxSetup({
  8. type:"POST",
  9. url: "<?php echo base_url('index.php/select/ambil_data') ?>",
  10. cache: false,
  11. });
  12.  
  13. $("#provinsi").change(function(){
  14.  
  15. var value=$(this).val();
  16. if(value>0){
  17. $.ajax({
  18. data:{modul:'kabupaten',id:value},
  19. success: function(respond){
  20. $("#kab").html(respond);
  21. }
  22. })
  23. }
  24.  
  25. });
  26.  
  27.  
  28. $("#kab").change(function(){
  29. var value=$(this).val();
  30. if(value>0){
  31. $.ajax({
  32. data:{modul:'kecamatan',id:value},
  33. success: function(respond){
  34. $("#kec").html(respond);
  35. }
  36. })
  37. }
  38. })
  39.  
  40. $("#kec").change(function(){
  41. var value=$(this).val();
  42. if(value>0){
  43. $.ajax({
  44. data:{modul:'kelurahan',id:value},
  45. success: function(respond){
  46. $("#desa").html(respond);
  47. }
  48. })
  49. }
  50. })
  51.  
  52. $("#fakultas").change(function(){
  53.  
  54. var value=$(this).val();
  55. if(value>0){
  56. $.ajax({
  57. data:{modul:'jurusan',id:value},
  58. success: function(respond){
  59. $("#jurusan").html(respond);
  60. }
  61. })
  62. }
  63.  
  64. });
  65.  
  66. $(".flat").click(function () {
  67.  
  68. var value=$(this).val();
  69. if(value=value.checked){
  70. $.ajax({
  71. data:{modul:'kamar_akhwat',id:value},
  72. success: function(respond){
  73. $("#kamar").html(respond);
  74. }
  75. })
  76. }
  77.  
  78. });
  79.  
  80. })
  81.  
  82.  
  83. </script>
  84. <script type="text/javascript">
  85. function check1() {
  86. var x=document.getElementById("j_kI");
  87. var kamar=document.getElementById("kamar");
  88. if(x=x.checked){
  89. alert("Tes");
  90. }
  91. }
  92. </script>
  93. <form action="<?php echo $action; ?>" method="post" id="demo-form2" data-parsley-validate="" class="form-horizontal form-label-left" novalidate="">
  94. <div class="form-group">
  95. <label class="control-label col-md-3 col-sm-3 col-xs-12">Jenis Kelamin
  96. </label>
  97. <div class="col-md-6 col-sm-6 col-xs-12">
  98. Laki-laki: <input id="j_kI" type="radio" name="j_k" value="j_kI" />
  99. Perempuan: <input type="radio" name="j_k" id="j_kA" value="j_k" />
  100. </div>
  101. </div>
  102. <div class="form-group">
  103. <label class="control-label col-md-3 col-sm-3 col-xs-12" for="varchar">Kamar <?php echo form_error('kamar') ?></label>
  104. <div class="col-md-6 col-sm-6 col-xs-12">
  105. <select id="kamar" class="form-control" name="kamar">
  106. <option value='0'>--pilih--</option>
  107. </select>
  108.  
  109. </div>
  110. </div>
  111. </form>
Add Comment
Please, Sign In to add comment