Advertisement
Guest User

Untitled

a guest
Feb 26th, 2020
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.88 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <title><?php echo $title; ?></title>
  7. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
  8. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
  9. </head>
  10. <body>
  11.  
  12. <div class="container">
  13. <div class="row">
  14. <div class="box-header with-border">
  15. <div class="text-center">
  16. <h2 align="center">Tutorial Codeigniter</h2>
  17. <h3 class="box-title"><?php echo $title; ?></h3>
  18. </div>
  19. </div>
  20. <div class="col-md-12" style="margin: 10px;">
  21. <div class="box box-solid">
  22. <div class="box-body">
  23. <blockquote>
  24. <p><h>Keterangan!!</h></p>
  25. <small><cite title="Source Title">Inputan Yang Ditanda Bintang Merah (<span style="color: red;">*</span>) Harus Di Isi !!</cite></small>
  26. </blockquote>
  27. </div>
  28. </div>
  29. <br>
  30. <div class="col-md-12">
  31. <table class="table table-bordered" id="tableLoop">
  32. <thead>
  33. <tr>
  34. <th class="text-center">#</th>
  35. <th>First Name</th>
  36. <th>Last Name</th>
  37. <th><button class="btn btn-success btn-block" id="BarisBaru"><i class="fa fa-plus"></i> Baris Baru</button></th>
  38. </tr>
  39. </thead>
  40. </table>
  41. </div>
  42. </div>
  43. </div>
  44. </div>
  45. </body>
  46. <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
  47. <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.2.2/bootstrap.min.js"></script>
  48.  
  49.  
  50. <script type="text/javascript">
  51. $(document).ready(function() {
  52. for (B=1; B<=1; B++) {
  53. Barisbaru();
  54. }
  55. $('#BarisBaru').click(function(e) {
  56. e.preventDefault();
  57. Barisbaru();
  58. });
  59.  
  60. $("tableLoop tbody").find('input[type=text]').filter(':visible:first').focus();
  61. });
  62. function Barisbaru() {
  63. $(document).ready(function() {
  64. $("[data-toggle='tooltip'").tooltip();
  65. });
  66. var Nomor = $("#tableLoop tbody tr").length + 1;
  67. var Baris = '<tr>';
  68. Baris += '<td class="text-center">'+Nomor+'</td>';
  69. Baris += '<td>';
  70. Baris += '<input type="text" name="first_name[]" class="form-control" placeholder="First Name..." required="">';
  71. Baris += '</td>';
  72. Baris += '<td>';
  73. Baris += '<input type="text" name="last_name[]" class="form-control" placeholder="Last Name..." required="">';
  74. Baris += '</td>';
  75. Baris += '<td class="text-center">';
  76. Baris += '<a class="btn btn-sm btn-danger" data-toggle="tooltip" title="Hapus Baris"><i class="fa fa-times"></i></a>';
  77. Baris += '</td>';
  78. Baris += '</tr>';
  79.  
  80. $("#tableLoop tbody").append(Baris);
  81. $("#tableLoop tbody tr").each(function () {
  82. $(this).find('td:nth-child(2) input').focus();
  83. });
  84. }
  85. </script>
  86. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement