News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

JavaScript Problem

Started by [darksteel], June 23, 2005, 04:14:06 PM

Previous topic - Next topic

[darksteel]

 :D Hi. I have problem whit javascript:

I use:
java.js:
// Alerta
function confirmation() {
var answer = confirm("Delete News?")
if (answer){
window.location = "index.php?op=recipiente";
}
else{
alert("Thanks for sticking around!")
}
}


and in the file:
<a href='index.php?op=recipiente&eliminar&id=$idc' onclick=confirmation()> Eliminar</b></a>

When I click ELiminar show Alert, but I press CANCEL and the java delete this news, not cancel.



Luis "[darksteel]" Alvarado.
Spanish Support
¿Qué es el repair_settings?
No doy soporte por PM, publica tu duda en el foro y tendras respuestas mas rapidas.
My forum:
www.caamboard.com

[Unknown]

In the onclick, you want to return the result of the confirm function.

-[Unknown]

morph

#2
Incase you didn't know what [Unknown] meant..

Replace:
<a href='index.php?op=recipiente&eliminar&id=$idc' onclick=confirmation()> Eliminar</b></a>

With:
<a href='index.php?op=recipiente&eliminar&id=$idc' onclick="return confirmation();"> Eliminar</b></a>

Coming soon!

[darksteel]

Quote from: morph on June 24, 2005, 10:50:16 PM
Incase you didn't know what [Unknown] meant..

Replace:
<a href='index.php?op=recipiente&eliminar&id=$idc' onclick=confirmation()> Eliminar</b></a>

With:
<a href='index.php?op=recipiente&eliminar&id=$idc' onclick="return confirmation();"> Eliminar</b></a>

Thanks morph



Luis "[darksteel]" Alvarado.
Spanish Support
¿Qué es el repair_settings?
No doy soporte por PM, publica tu duda en el foro y tendras respuestas mas rapidas.
My forum:
www.caamboard.com

Advertisement: