form
of register a select
field that is populated with data coming from the database, however with the use of Bootstrap Validator
, it does not validate correctly, now if I take the code PHP
it validates correctly.
What can be this.
Below is my select field:
<div class="form-group">
<label for="AgentePG" class=" control-label">PG</label>
<select class="form-control" id="AgentePG" name="pg" data-bv-notempty data-bv-notempty-message="The country is required">
<option value="">Selecione...</option>
<?php
$sql = DB::getInstance();
$sql = "SELECT * FROM pg";
$stmt = DB::prepare($sql);
$stmt->execute();
$busca = $stmt->fetchAll();
foreach ($busca as $linha) {
echo '<option value=' . $linha->id . '>' . $linha->pg . </option>';
}
?>
</select>
</div>