I have this great questionnaire, in a modal that when I click the record button, the button does not redirect to the page I want. The error is not of the page registrar.php
because I had put a simple alert
in it, and it did not work, besides when I click the button nothing happens. This has worked once, but crashed I do not give a damn because. If someone finds some error thank you, I'm already hours trying to find.
<!-- Modal -->
<div class="modal fade" id="myModal" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header" style="background-color:#0066cc; color:#FFF;">
<button type="button" class="close" data-dismiss="modal">×</button>
<h1 class="modal-title">Registrar Aluno</h1>
</div>
<div class="modal-body" style="font-size:20px;">
<form action="registrar.php" method="POST">
<p> <i class="fa fa-credit-card fa-lg" aria-hidden="true"></i>
<input type="text" tabindex="1" name="n_processo" required placeholder="Nº Processo" maxlength="5" id="n_processo" style="font-size:18px; width:150px; border:1px solid #cccccc; padding-left:5px; border-radius: 5px;"> </p>
<br>
<p> <i class="fa fa-user fa-lg" aria-hidden="true"></i>
<input type="text" placeholder="Nome" onkeypress="return letras()" tabindex="2" name="nome" id="nome" required maxlength="150" style="font-size:18px; width:400px;border:1px solid #cccccc; padding-left:5px; border-radius: 5px;"> </p>
<br>
<p> <i class="fa fa-calendar fa-lg" aria-hidden="true"></i>
<select tabindex="3" name="dia" required>
<option disabled selected hidden value="">Dia</option>
<?
for($dia = 1; $dia <= 31; $dia++)
{
if($dia < 10) {
echo "<option>0$dia</option>";
}else
{
echo "<option>$dia</option>";
}
}
?>
</select>
<select tabindex="4" name="mes" required>
<option disabled selected hidden value="">Mês</option>
<?
for($mes = 1; $mes <= 12; $mes++)
{
if($mes < 10)
{
echo "<option>0$mes</option>";
}
else
{
echo "<option>$mes</option>";
}
}
?>
</select>
<select tabindex="5" name="ano" required>
<option disabled selected hidden value="">Ano</option>
<?
$hoje = date("Y");
for($ano = ($hoje-30); $ano <= ($hoje-14); $ano++)
{
echo "<option>$ano</option>";
}
?>
</select><br>
<font style="font-size: 15px;color:gray;font-style: italic;">Data de Nascimento</font>
</p>
<br>
<p> <i class="fa fa-university fa-lg" aria-hidden="true"></i>
<input type="text" tabindex="6" name="cc" id="cc" required maxlength="9" style="font-size:18px; width:100px; border:1px solid #cccccc; padding-left:5px; border-radius: 5px;text-align: center;">
-
<input type="text" tabindex="7" name="zz" id="zz" required maxlength="4" style="font-size:18px; width:70px; border:1px solid #cccccc; padding-left:5px; border-radius: 5px; text-transform: uppercase;text-align: center;">
<br>
<font style="font-size: 15px;color:gray;font-style: italic;">Cartão de Cidadão</font>
</p>
<br>
<!-- <p style="background-color: rgba(240, 11, 18, 0.8); border-radius: 5px; padding-left: 10px; padding-top: 5px;padding-bottom: 5px; font-size: 15px;">Cuidado! Os próximos campos, depois de criados não podem ser editados!</p> -->
<!-- -----------------------------CURSO------------------------------------------------- -->
<p><i class="fa fa-question-circle fa-lg" aria-hidden="true"></i>
<select tabindex="8" name="escolhe" id="tipo_curso" onchange="mostrar()" required="">
<option disabled selected hidden value="">Tipo do Curso</option>
<option>Profissional</option>
<option>Vocacional</option>
</select>
</p>
<br>
<!-- -----------------------------------DIV 1 ------------------------------------- -->
<div style="display: none;" id="curso_um">
<p> <i class="fa fa-graduation-cap fa-lg" aria-hidden="true"></i>
<select name='cursos1' required tabindex="9">
<option disabled selected hidden value="">Curso</option>
<?
$sql = "SELECT designacao FROM cursos WHERE id_tipo_curso = 1";
$resposta = mysql_query($sql,$conexao);
while ($row = mysql_fetch_array($resposta))
{
$sql = "SELECT designacao FROM cursos WHERE ";
echo "<option value='" . $row['designacao'] ."'> ".$row['designacao']."</option>";
}
?>
</select>
</p>
<br>
<P><i class="fa fa-clock-o fa-lg" aria-hidden="true"></i>
<input type="text" name="ciclo" id="ciclo" tabindex="10" maxlength="4" placeholder="2010" style="border:1px solid #cccccc; font-size:18px; letter-spacing: 2px; width:100px;border-radius: 5px; text-align: center;" onkeyup="tenta()" required>
-
<input type="text" name="ciclo2" id="lol" tabindex="11" placeholder="2013" readonly style="border:1px solid #cccccc; font-size:18px; letter-spacing: 2px; width:100px;border-radius: 5px; text-align: center;">
<br>
<font style="font-size: 15px;color:gray;font-style: italic;">Ciclo de Formação</font>
</P>
</div>
<!-- -----------------------------------DIV 2 ------------------------------------- -->
<div style="display: none;" id="curso_dois">
<p> <i class="fa fa-graduation-cap fa-lg" aria-hidden="true"></i>
<select name='cursos2' required tabindex="9">
<?
$sql = "SELECT designacao FROM cursos WHERE id_tipo_curso = 2";
$resposta = mysql_query($sql,$conexao);
while ($row = mysql_fetch_array($resposta))
{
$sql = "SELECT designacao FROM cursos WHERE ";
echo "<option value='" . $row['designacao'] ."'> ".$row['designacao']."</option>";
}
?>
</select>
</p>
<br>
<P><i class="fa fa-clock-o fa-lg" aria-hidden="true"></i>
<input type="text" name="ciclo3" id="ciclo3" tabindex="10" maxlength="4" placeholder="2010" style="border:1px solid #cccccc; font-size:18px; letter-spacing: 2px; width:100px;border-radius: 5px; text-align: center;" onkeyup="numeros2()" required>
-
<input type="text" name="ciclo4" id="ciclo4" tabindex="11" placeholder="2012" readonly style="border:1px solid #cccccc; font-size:18px; letter-spacing: 2px; width:100px;border-radius: 5px; text-align: center;">
<br>
<font style="font-size: 15px;color:gray;font-style: italic;">Cartão de Cidadão</font>
</P>
</div>
<div class="modal-footer">
<button type="submit" class="btn btn-primary"><i class="fa fa-floppy-o fa-2x"></i></button>
<button type="button" class="btn btn-default" data-dismiss="modal"><i class="fa fa-times fa-2x"></i></button>
</div>
</form>
</div>
</div>
</div>
</div>