Colleagues.
I have the Tabs in Ajax template and thanks to our colleague DontVoteMeDown, I get through the button type button to change tabs, but how would I do it so that when changing tabs, I register the information of the previous tab in the bank? The registration in PHP / Mysql I know how to do, what is happening is that when changing tab, the input does not occur, only if I use submit . See below (I changed the code and it is registering in the database, but how do I pass the form values to jquery?):
<script>
$(function() {
$( "#tabs" ).tabs();
$("#btnComprar").on("click", function()
{
$.post("cadastrar_.php", // Cadastando OK
{
// Como faço para pegar os valores do formulário e jogar para o campo abaixo?
nome: "nome do usuário",
idade: "idade"
},
function(data, status){
// alert("Data: " + data + "\nStatus: " + status);
});
var indice = $('#tabs ul li a[href="#' + $(this).parent().prop("id") + '"]').parent().index();
$("#tabs").tabs("option", "active", (indice + 1));
});
$(".voltar").on("click", function()
{
var indice = $('#tabs ul li a[href="#' + $(this).parent().prop("id") + '"]').parent().index();
$("#tabs").tabs("option", "active", (indice - 1));
});
});
</script>
<button type="button" id="btnComprar" class="proximo btn btn-success pull-right proximo" name="Valor" value="Comprar" style="margin-right: 10px" disabled="disabled"/><i class="fa fa-cart-plus"></i> Comprar </button>