Dear colleagues.
I have a button in the bootstrap:
<button class="btn btn-xs btn-primary active" name="Botao" value="Ativar" id="ativar">Ativar</button>
I would like the status to be changed to Disable by clicking this button, but without refreshing the page. I'm using the code below to direct to the page that makes the change, but it looks like it's not going. See:
$(document).ready(function() {
$('#ativar').click(function() {
var valor = $(this).attr('value');
$.ajax ({
type: "POST",
url: "alterar.php?Key="+valor,
data: datastring
})
});
});
The change in PHP is OK when I go directly to the page change.php, but the button does not seem to be able to see the page.