Advertisement
dhiforester

Form tambah pasien

Dec 4th, 2023 (edited)
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.68 KB | Software | 0 0
  1. <script>
  2. //Proses Simpan Data Ke Database
  3. $('#ProsesTambahPasien').submit(function(){
  4. var ProsesTambahPasien=$('#ProsesTambahPasien').serialize();
  5. $.ajax({
  6. type : 'POST',
  7. url : '_Page/Pasien/ProsesTambahPasien.php',
  8. data : ProsesTambahPasien,
  9. success : function(data){
  10. $('#NotifikasiTambahPasien').html(data);
  11. var NotifikasiTambahPasienBerhasil=$('#NotifikasiTambahPasienBerhasil').html();
  12. if(NotifikasiTambahPasienBerhasil=="Success"){
  13. $("#ProsesTambahPasien")[0].reset();
  14. }
  15. }
  16. });
  17. });
  18. </script>
  19. <div class="row mb-4">
  20. <div class="col-md-12">
  21. <h1>Form Tambah pasien</h1>
  22. </div>
  23. </div>
  24. <form action="javascript:void(0);" id="ProsesTambahPasien">
  25. <div class="row mb-3">
  26. <div class="col-md-3">
  27. <label for="nama">Nama Pasien</label>
  28. </div>
  29. <div class="col-md-9">
  30. <input type="text" name="nama" id="nama" class="form-control">
  31. </div>
  32. </div>
  33. <div class="row mb-3">
  34. <div class="col-md-3">
  35. <label for="kontak">Nomor Kontak</label>
  36. </div>
  37. <div class="col-md-9">
  38. <input type="text" name="kontak" id="kontak" class="form-control">
  39. </div>
  40. </div>
  41. <div class="row mb-3">
  42. <div class="col-md-3">
  43. <label for="alamat">Alamat</label>
  44. </div>
  45. <div class="col-md-9">
  46. <textarea name="alamat" id="alamat" class="form-control"></textarea>
  47. </div>
  48. </div>
  49. <div class="row mb-3">
  50. <div class="col-md-3">
  51. <label for="tempat_lahir">Tempat Lahir</label>
  52. </div>
  53. <div class="col-md-9">
  54. <input type="text" name="tempat_lahir" id="tempat_lahir" class="form-control">
  55. </div>
  56. </div>
  57. <div class="row mb-3">
  58. <div class="col-md-3">
  59. <label for="tanggal_lahir">Tanggal Lahir</label>
  60. </div>
  61. <div class="col-md-9">
  62. <input type="date" name="tanggal_lahir" id="tanggal_lahir" class="form-control">
  63. </div>
  64. </div>
  65. <div class="row mb-3">
  66. <div class="col-md-3"></div>
  67. <div class="col-md-9" id="NotifikasiTambahPasien">
  68. <span class="text-primary">Pastikan Informasi Pasien Yang Anda Input Sudah Benar</span>
  69. </div>
  70. </div>
  71. <div class="row mb-3">
  72. <div class="col-md-3">
  73. <button type="submit" class="btn btn-md btn-bd-primary btn-block">
  74. Simpan
  75. </button>
  76. </div>
  77. </div>
  78. </form>
Tags: php form add
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement