![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
03/07/2007, 06:17
|
| | Fecha de Ingreso: abril-2007
Mensajes: 8
Antigüedad: 17 años, 9 meses Puntos: 0 | |
Re: boton que me redireccione a otra pagina // Aquí esta el código completo de una pagina con esa función
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<script language="javascript" type="text/javascript">
function enviar(pagina){
document.nombreDelFormulario.action = pagina;
document.nombreDelFormulario.submit();
}
</script>
</head>
<body>
<form name="nombreDelFormulario" action="" method="post">
<input type="button" value="ir a pagina 1" onClick="enviar('pagina1.html')">
<input type="button" value="ir a pagina 2" onClick="enviar('pagina2.html')">
</form>
</body>
</html>
observa que para que nos funcione este script debes utilizar inputs tipo button.
espero haber sido de ayuda saludos
(escribe a ver que tal te fue) |