Combo Selectoption - Variable 0

Asked

Viewed 15 times

1

I have an HTML page with some tables. among these tables contains a Comboselect and in the last table an input text to fill in a date. When I select the comboselect and enter the date and submit the page, the data of the comboselect is not saved correctly in the database, just adding the "0". In apache the error indicates that the combo select variable has not been defined/fed:

Undefined index: selectteste

Form

           <td>
             </a>
               &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp<a class="btn btn-danger" href="xxx.php?id=<?php echo $fetch['id']?>" aria-label="Settings">

              </a>

         </td>
   <form action="xxx.php?id=<?php echo $fetch['id']?>" method=post>
   <td><select name="selectteste" class="form-control"><meta charset="UTF-8">
   <option value="Teste">Teste Form</option>

</select>





<!-- Text input-->
<!--<form action="xxx.php?id=<?php echo $fetch['id']?>" method=post>-->

<td>

  <input  name="protocolo" type="text" placeholder="00/00/0000" style="width:100px;font-size: 13px" class="form-control protocolo input-md">
 <br>

  <input id="btn" type="submit"  class="btn btn-primary" value="OK" />

  </td>
</div>

Page.php - Post

$selectcombo = $_POST['selectteste'];

The only difference that these tables are inside a While, because there is other information to be shown. I have already played the beginning of the <form> at the top of the page and nothing, but I have no idea how to solve.

  • My mistake, the table that would receive this data was as whole, and so was not fed. I removed the column and inserted again as varchar and it worked.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.