Forum Moderators: open
i have a page that has a table that lists the data from a MySQL databse and in that list, every item has a link to delete that has a function:
function apagar(val,ite) {
if(confirm('Deseja apagar o item: '+ite+'?'))
window.location='<?= $PHP_SELF?>?apagar='+val;
}
Then the delete link is written like this:
<a href="JavaScript:apagar('<?= $dados['id']?>','<?= $dados['titulo']?>');">Apagar</a>
So, when $dados['titulo'], has a quote or double quote Charater, the function doesn't work, because the javascript reads the quote character has the end of the string.
how can I solve this?
thanx