0

Why am I getting this error when I submit my form?

<table name="table5" id="table5" width="500" border="1" cellspacing="0" cellpadding="3" align="center">
  <form name="form5" class="form5" id="form5" action="stoixeiarantevou.php" method="post">
    <td>
      <?php
        $sql = "SELECT username FROM giatros";
         $result = $conn->query($sql);

        if ($result->num_rows > 0) {
        ?>
      <div id="doc">
        Γιατρός:
        <select name="Giatros" id="Giatros">
          <?php
            // output data of each row
            while($row = $result->fetch_assoc()) {
            ?>
          <option value="<?php echo $row['Giatros']; ?>"><?php echo $row['username'];?></option>
          <?php
            }
            ?>
        </select>
      </div>
      <?php
        }
        $conn->close();
        ?>
      Ημερομηνία: <input type="text" id="Hmeromhnia" name="Hmeromhnia" required> <br>
      Ώρα: <input type="text" id="Wra" name="Wra" required><br>
      <input type="button" id="Δημιουργία" value="Δημιουργία" name="Δημιουργία" id="btnsubmit" onclick="submitForm3()" required>
    </td>
    <script>
      function submitForm3() {
         // Get the first form with the name
          // Hopefully there is only one, but there are more, select the correct index
          var frm = document.getElementsByName('form5')[0];
          frm.submit(); // Submit
          frm.reset();  // Reset
          alert("Τα στοιχεία σας ανανεώθηκαν επιτυχώς");
          return false; // Prevent page refresh

         }


    </script>
  </form>
</table>
<div class="footer">
  <hr>
  &copy Medicare
</div>
Nikos Bounas
  • 11
  • 1
  • 5

0 Answers0