Forum Moderators: open
<script language="javascript" type="text/javascript">
<!--
function editar(comentario) {
location.replace("?seccion=EditarComent&comentario=" + comentario);
}
function borrar(comentario) {
var respuesta = confirm("¿Seguro que quieres eliminar este comentario?")
if(respuesta){
location.replace("?seccion=BorrarComent&comentario=" + comentario);
}
}
function bloquear(comentario) {
var respuesta = confirm("¿Seguro que quieres bloquear a este usuario?")
if(respuesta){
location.replace("?seccion=BloqComent&comentario=" + comentario);
}
}
-->
</script><form name="formulario" enctype="multipart/form-data">
<h2>Acceso Rápido</h2>
<p>Si conoces el #ID del comentario que quieres borrar, editar o bloquear al usuario
que lo ha escrito, solo tienes que escribir a continuación el ID y seleccionar
la opción deseada.</p>
<table style="border-width: 0; width: 100%">
<tr>
<td><b>ID del Comentario: <input type="text" name="comentario" />
<input type="button" value="Borrar" OnClick="javascript: borrar(document.formulario.comentario.value); return false;">
<input type="button" value="Bloquear" OnClick="javascript: bloquear(document.formulario.comentario.value); return false;">
<input type="button" value="Editar" OnClick="javascript: editar(document.formulario.comentario.value); return false;">
</td>
</tr>
</table>
</form>
I get the following error in firebug:
document.formulario.comentario is undefined
[Break on this error] editar(document.formulario.comentario.value);
Thanks for helping.
Nesting error: "<b>" should be close before closing table
... but it ran OK even with that in place. I also got "ASCII values greater than 127 found, use (appropriate entity) instead" but that might just be from the copy/paste. (Rápido, continuación ...)
Did you try running just this code on the page as you have it here? It may be some other element on the page mucking up the code. If invalid code causes a form to close prematurely, the browser won't recognize the form and won't run JS . . .
EDIT:
You can remove the comments entirely, or just fix the last one . . .
-->
</script>
Like so
//-->
</script>
since the closing comment is within the Javascript, normally this will cause an error because --> is not valid Javascript. Seems later browsers are forgiving of this . . . perhaps yours is not.