I started to learn javascript, I have a short time and I am quite a lay person.
Then ...
I'm trying to replace alert windows with custom manners. Then when I click the edit button for example, it opens my confirmation window and if I click OK it will redirect me to the editing page.
I would like the redirect of the page to be sent the id of the user caught in the database, passing it through the url with window.location = ''; or another redirector. I do not know if you can do that.
If anyone can help, I'll be grateful.
Confirm
<body>
<?php foreach($usuario->findAll() as $key => $value): ?>
<?php
$id = $value->id;
$nome = $value->nome;
$nascimento = $value->nascimento;
$sexo = $value->sexo;
$uf = $value->uf;
?>
<b>Nome:</b> <?php echo $nome; ?> <br>
<b>Nascimento:</b> <?php echo $nascimento; ?><br>
<b>Sexo:</b> <?php echo $sexo; ?><br>
<b>UF:</b> <?php echo $uf; ?><br>
<?php echo "<button onclick='doAlert();'>Editar</button>"; ?><br><br>
<?php endforeach; ?>
<script type="text/javascript">
function doAlert(){
var msg = new DOMAlert({
title: 'Confirme',
text: 'Mensagem de alerta - testes.',
skin: 'default',
width: 300,
ok: {value: true, text: 'Ok', onclick: open},
cancel: {value: false, text: 'Cancelar', onclick: close }
});
msg.show();
};
function close(sender, value){
sender.close();
}
function open(sender, value){
/*PEGAR ID DO USUARIO E PASSAR VIA URL */
window.location='';
}
</script>
</body>