Salam programmer
Saya mau bertanya tentang penggunaan multiple form
Jadi kasusnya begini :
Pada halaman tambah Risalah terdapat beberapa fitur yaitu nama, kode, judul, tgl dll
Dan satu fitur lagi yaitu Tambah Debitur, kan jumlah debitur tidak selalu satu bagaimana cara memberi fitur tersebut?
Saya menggunakan form didalam form dan ternyata setelah submit form pertama trus disubmit form kedua data dari form pertama tidak muncul ketika akan dimasukkan kedatabase
  1. <form action='' method='post' name='frm-tambah'> //FORM PERTAMAA !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  2. <table>
  3. <tr>
  4. <td>Nomor Risalah</td><td> : </td>
  5. <td><input type='text' name='kd_risalah' id='kb' value='<?php echo $valKB; ?>'></td>
  6. </tr>
  7. <tr>
  8. <td>Pemohon Risalah</td><td> : </td>
  9. <td><input type='text' name='no_surat'></td>
  10. </tr>
  11. <tr>
  12. <td>Penanggung jawab</td><td> : </td>
  13. <td><?php
  14. echo "<select name='pl'>";
  15. $tampil=mysql_query("SELECT * FROM pl ORDER BY id");
  16. echo "<option value='' selected>- Pilih Salah Satu -</option>";
  17.  
  18. while($w=mysql_fetch_array($tampil))
  19. {
  20. echo "<option value=$w[nama]>$w[nama]</option>";
  21. }
  22. echo "</select>";
  23. ?>
  24. </td>
  25.  
  26.  
  27. </tr>
  28. <tr>
  29. <td>Tanggal Surat</td><td> : </td>
  30. <td><input type='text' name='tahun' size='10' value='<?php echo $arr['tgl_masuk']; ?>'></td>
  31. </tr>
  32. <tr>
  33. <td>Pemohon</td><td> : </td>
  34. <td><input type='text' name='pemohon' value="<?php echo $arr['pemohon']; ?>"></td>
  35. </tr>
  36. <tr>
  37. <td>Limit Lelang</td><td> : </td>
  38. <td><input type='text' name='lmt' size='10' value="<?php echo $arr['lmt']; ?>"></td>
  39. </tr>
  40. <tr>
  41. <td>Baru/Ulang </td><td> : </td>
  42. <td><select name='lmt'>
  43. <option value='B'>Baru</option>
  44. <option value='U'>Ulang</option>
  45. </select>
  46. </td>
  47.  
  48. </tr>
  49. <form action="#" method="post"> //FORM KEDUA !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  50. <tr>
  51. <td>Input Jumlah Debitur</td><td> : </td>
  52. <td>
  53. <select name="jmldbt<?php echo $jumlah; ?>"><br>
  54. <option value='1'>1</option>
  55. <option value='2'>2</option>
  56. <option value='3'>3</option>
  57. <option value='4'>4</option>
  58. <option value='5'>5</option>
  59. </select>
  60. </td>
  61. <td><input type="submit" name="tambahdt" value="+" class="btn btn-info"></td>
  62. </form>
  63. </tr>
  64. <?php
  65. if($_POST['jmldbt'])
  66. {
  67. ?>
  68.  
  69. <?php
  70. $jumlah = $_POST['jmldbt'];
  71.  
  72. for($a=1;$a<=$jumlah;$a++)
  73. {
  74. ?>
  75. <tr>
  76. <td>Debitur Ke - <?php echo $a; ?></td><td> : </td>
  77.  
  78.  
  79. <td><input type="text" name="nmdbt<?php echo $jumlah; ?>"><br></td>
  80. </tr>
  81. <?php
  82. }
  83. ?>
  84.  
  85.  
  86. <?php
  87. }
  88. ?>
  89. <tr>
  90. <td>Lokasi Risalah</td><td> : </td>
  91. <td><select name='lemari'style="width: 140px;">
  92. <option value=''>--Lemari--</option>
  93. <option value='Lemari 1984'>Lemari 1984</option>
  94. <option value='Lemari 1985'>Lemari 1985</option>
  95. <option value='Lemari 1986'>Lemari 1986</option>
  96. <option value='Lemari 1987'>Lemari 1987</option>
  97. <option value='Lemari 1988'>Lemari 1988</option>
  98. <option value='Lemari 1989'>Lemari 1989</option>
  99. <option value='Lemari 1990'>Lemari 1990</option>
  100. <option value='Lemari 1991'>Lemari 1991</option>
  101. <option value='Lemari 1992'>Lemari 1992</option>
  102. <option value='Lemari 1993'>Lemari 1993</option>
  103. <option value='Lemari 1994'>Lemari 1994</option>
  104. <option value='Lemari 1995'>Lemari 1995</option>
  105. <option value='Lemari 1996'>Lemari 1996</option>
  106. <option value='Lemari 1997'>Lemari 1997</option>
  107. <option value='Lemari 1998'>Lemari 1998</option>
  108. <option value='Lemari 1999'>Lemari 1999</option>
  109. <option value='Lemari 2000'>Lemari 2000</option>
  110. <option value='Lemari 2001'>Lemari 2001</option>
  111. <option value='Lemari 2002'>Lemari 2002</option>
  112. <option value='Lemari 2003'>Lemari 2003</option>
  113. <option value='Lemari 2004'>Lemari 2004</option>
  114. <option value='Lemari 2005'>Lemari 2005</option>
  115. <option value='Lemari 2006'>Lemari 2006</option>
  116. <option value='Lemari 2007'>Lemari 2007</option>
  117. <option value='Lemari 2008'>Lemari 2008</option>
  118. <option value='Lemari 2009'>Lemari 2009</option>
  119. <option value='Lemari 2010'>Lemari 2010</option>
  120. <option value='Lemari 2011'>Lemari 2011</option>
  121. <option value='Lemari 2012'>Lemari 2012</option>
  122. <option value='Lemari 2013'>Lemari 2013</option>
  123. <option value='Lemari 2014'>Lemari 2014</option>
  124. <option value='Lemari 2015'>Lemari 2015</option>
  125. <option value='Lemari 2016'>Lemari 2016</option>
  126. <option value='Lemari 2017'>Lemari 2017</option>
  127. <option value='Lemari 2018'>Lemari 2018</option>
  128.  
  129. </select>
  130.  
  131. <select name='indeks' style="width: 100px;">
  132. <option value=''>--Indeks--</option>
  133. <option value='Indeks A'>Indeks A</option>
  134. <option value='Indeks B'>Indeks B</option>
  135. <option value='Indeks C'>Indeks C</option>
  136. <option value='Indeks D'>Indeks D</option>
  137. <option value='Indeks E'>Indeks E</option>
  138.  
  139. </select>
  140. <select name='rak' style="width: 100px;">
  141. <option value=''>--Rak--</option>
  142. <option value='Rak 1'>Rak 1</option>
  143. <option value='Rak 2'>Rak 2</option>
  144. <option value='Rak 3'>Rak 3</option>
  145. <option value='Rak 4'>Rak 4</option>
  146. <option value='Rak 5'>Rak 5</option>
  147. <option value='Rak 6'>Rak 6</option>
  148.  
  149. </select>
  150.  
  151. </td>
  152.  
  153. </tr>
  154.  
  155. <tr><td colspan='3'><input class="btn btn-info" type='submit' value='Tambah' name='tambah'></td></tr>
  156. </table>
  157. </form>
15230
Please login to answer!
/sangkep/answer/add-json/nogzip/1
/sangkep/answer/send-notification