我想提醒我在表单上选择的内容。
这是我在myform上的下拉列表
<!-- PEMILIHAN TEMA -->
<?php
echo "<center><div style='display:none;' id='formtugas'>";
echo "<select id='tema' name='tema' class='form-control5' required>";
$querytema = mysqli_query($dbh,"SELECT KodeTema, NamaTema FROM tema WHERE KodeKelas='1'");
echo "<option selected disabled>Pilih Tema berdasarkan Tugas</option>";
while ($ambiltema = mysqli_fetch_array($querytema))
{
echo "<option value='".$ambiltema['NamaTema']."'>".$ambiltema['NamaTema']."</option>";
}
echo "</select>";
echo "<br>";
?>
<!-- END -->
<!-- PEMILIHAN MATA PELAJARAN -->
<?php
echo "<center>";
echo "<select id='mapel' name='mapel' class='form-control5' required>";
$querymapel = mysqli_query($dbh,"SELECT KodeMapel, NamaMapel FROM mapel");
echo "<option selected disabled>Pilih Mata Pelajaran berdasarkan Tugas</option>";
while ($ambilmapel = mysqli_fetch_array($querymapel))
{
echo "<option value='".$ambilmapel['NamaMapel']."'>".$ambilmapel['NamaMapel']."</option>";
}
echo "</select>";
echo "</div><br>";
?>
<!-- END -->
这是我的ajax javascript
$(document).ready(function(e) {
$("#myform").submit(function(e) {
$.ajax({
type: "GET",
url: "Pengetahuan/daftarTugas.php",
data:
$("#myform").serialize(),
success: function(data)
{
alert("Pilihan : " + $("#myform").serialize());
$('#tabelTugas').html(data);
$('#dataTable').DataTable();
}
});
e.preventDefault(); // avoid to execute the actual submit of the form.
}); });
此警报就像这样给了我 Alert based on that code
我想要提醒节目 &#34; Pilihan:NamaTema + NamaMapel&#34;