1
I have a read that receives various values, they have the same class. I need to take these values and pass to Hidden fields to send via $_POST to a PHP page. I was able to bring the data I need, but now I need to pass this data one by one.
$(function() {
var x = [];
$('#selecao .active').each(function() {
x.push($(this).val());
});
$('.p').text(x);
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<div id="selecao">
<input type="text" class="active" value="Conteudo 1" />
<input type="text" class="active" value="Conteudo 2" />
<input type="text" class="active" value="Conteudo 3" />
<input type="text" class="active" value="Conteudo 4" />
<input type="text" class="active" value="Conteudo 5" />
<input type="text" class="active" value="Conteudo 6" />
<input type="text" class="active" value="Conteudo 7" />
<input type="text" class="active" value="Conteudo 8" />
<input type="text" class="active" value="Conteudo 9" />
<input type="text" class="active" value="Conteudo 10" />
<p class="p"></p>
</div>