Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/08/2010, 12:41
lopedd
 
Fecha de Ingreso: agosto-2010
Mensajes: 7
Antigüedad: 13 años, 8 meses
Puntos: 0
Ayuda con un button plis

Hola, a ver si alguien me puede solucionar este problemilla, que tengo con el Aceptar - Cancelar de Javascript. He logrado que funcione con un "href" pero querria saber como se haria con un button, este es el codigo que tengo, que me funciona con el href:


<html>
<title>
Listado de Iluminacion Existente
</title>
<head>
<script LANGUAGE="JavaScript">

function confirmSubmit()
{
var agree=confirm("Está seguro de eliminar este registro?");
if (agree)
return true ;
else
return false ;
}

</script>



</head>

<body>

<?php
include "panel.php";
$conexion = mysql_connect('localhost','root','');
$sentenciaSQL = 'SELECT * FROM calculed.existente';
$resultados = mysql_query($sentenciaSQL);



?>
<table width="700" border="1" align="center">
<tr>
<td>Tipo</td>
<td>Modelo</td>
<td>Tension</td>
<td>Vida</td>
<td>Grados</td>
<td>Precio</td>
<td>M.Obra</td>
</tr>
<?php
while ($fila = mysql_fetch_assoc($resultados)) {
?>

<tr>


<form name="listaexistente" id="form" action="borrar_existente.php" method="GET">


<?php echo "<td><em>" .$fila["tipo"]."</td></em>";?>
<?php echo "<td>" .$fila["modelo"]."</td>";?>
<?php echo "<td>" .$fila["tension"]."</td>";?>
<?php echo "<td>" .$fila["vida"]."</td>";?>
<?php echo "<td>" .$fila["grados"]."</td>";?>
<?php echo "<td>" .$fila["precio"]."</td>";?>
<?php echo "<td>" .$fila["mano"]."</td>";?>
<?php echo "<td> <img src='./imagenes/".$fila["imagen"]."' height=100 widht=100/></td>";?>
<?php echo "<input type='hidden' name='id' value='" .$fila["id"]."'/>";?>
<?php <td><a onclick="return confirmSubmit()" href="borrar_existente.php?id=<?php echo $fila['id'];?>">Eliminar</a><td>
</form>
</tr>
<?php
}
?>
</table>
</body>
</html>


Un saludo y gracias por la ayuda!!!