Ver Mensaje Individual
  #1 (permalink)  
Antiguo 08/12/2011, 05:20
rugaib123
 
Fecha de Ingreso: agosto-2011
Mensajes: 8
Antigüedad: 12 años, 8 meses
Puntos: 0
2 funciones en un mismo botón

Hola.
Necesito una mano. No se me imprimen las imágenes; sólo el "alert" y no sé por qué.
Muchas gracias.
<html>

<head>
<script type="text/javascript">
<!--
function SetImage(id, filename)
{
var elem=document.getElementById(id);
if(elem)
{
elem.src=filename;
}
}
//-->
</script>
<SCRIPT language=JavaScript>
onload=init;
function init()
{
document.form1.Button1.onclick=pruebaClic;
}
function pruebaClic()
{
alert("¡ El botón ha sido pulsado !");
}
</SCRIPT>
</head>
<body>
<FORM name=form1>
<input type="submit" id="Button1" onclick="SetImage('Shape1','images/alligator.gif');
SetImage('Shape2','images/España.jpg');
return false;" name="pepe" value="Submit" style="position:absolute;left:277px;top:260px;widt h:96px;height:25px;font-family:Arial;font-size:13px;z-index:0">
<div id="wb_Shape1" style="margin:0;padding:0;position:absolute;left:5 45px;top:290px;width:92px;height:55px;text-align:center;z-index:1;">
<img src="images/img0001.gif" id="Shape1" alt="" title="" style="border-width:0;width:92px;height:55px"></div>
<div id="wb_Shape2" style="margin:0;padding:0;position:absolute;left:5 37px;top:224px;width:86px;height:35px;text-align:center;z-index:2;">
<img src="images/img0002.gif" id="Shape2" alt="" title="" style="border-width:0;width:86px;height:35px"></div>
</FORM>
</body>
</html>