I'm a beginner in PHP and I'm having a hard time finding a solution to my problem. I have a main array with 7 arrays , with 2 fields each, which are tabs in one of the urls of the site.
I need to click on the 'next step' button to be redirected to the second tab, but I could not do either json or javascript. Can anyone help me?
Below is part of the code.
$topicos = array(
array(
"id" => 1,
"label" => "Formação"
),
array(
"id" => 2,
"label" => "Cursos Extra Curriculares"
),
array(
"id" => 3,
"label" => "Experiências Profissionais"
),
array(
"id" => 4,
"label" => "Experiências Internacionais"
),
array(
"id" => 5,
"label" => "Idiomas"
),
array(
"id" => 6,
"label" => "Conhecimentos Técnicos Específicos"
),
array(
"id" => 7,
"label" => "Outras Informações"
)
);
<form action="<?= $path ?>banco_de_talentos_add_2" id="segundo_formulario" method="post" enctype="multipart/form-data">
<input type="hidden" id="proxima" name="proxima" value="0"/>
<div class="row-fluid ">
<div class="span12">
<div class="dropdown_protect"></div>
<div class="tab-header">
<ul id="tab-content" class="nav nav-tabs classe_a_ocultar_em_smartphone classe_a_ocultar_em_tablet">
<?php
foreach ($topicos as $t):
if($t["id"] == 1):
echo "<li class='active'><a href='#tab" . $t["id"] . "'>" . $t["label"] . "</a></li>";
else:
echo "<li><a id='ir_para_questionario' href='#tab" . $t["id"] . "'>" . $t["label"] . "</a></li>";
endif;
endforeach;
?>
</ul>
</div><!--tab-header-->
<div class="tab-content">
<?php foreach($topicos as $t):
if($t["id"] == 1):
echo '<div id="tab' . $t["id"] . '" class="tab-pane active">';
else:
echo '<div id="tab' . $t["id"] . '" class="tab-pane">';
endif;
include "banco_de_talentos_formulario_" . $t["id"] . ".php";
echo '</div>';
endforeach; ?>
</div>
</div>
</div>
<div style="width:100%;text-align:center">
<input type="submit" value="Salvar" class="btn"/>
<input type="button" id="btn_anterior" value="Etapa Anterior" class="btn" onClick="document.getElementById('proxima').value = 2; document.getElementById('segundo_formulario').submit()"/>
<input type="button" id="btn_proxima" value="Próxima Etapa" class="btn" onClick="document.getElementById('proxima').value = 1; document.getElementById('segundo_formulario').submit()"/>
<!-- <input type=button value="Proxima aba" class="btn" id="new_tab" onkeydown="tab()"> -->
</div>