![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
08/01/2009, 03:47
|
| | Fecha de Ingreso: enero-2009
Mensajes: 11
Antigüedad: 16 años, 1 mes Puntos: 0 | |
Respuesta: Boton que selecciona item de menu desplegable AL fin si!!! Bueno, toqueteando un buen rato al final lo conseguí, lo cuelgo aquí por si a alguien le puede ayudar algún dia.
En lugar de enviar la id del botón, finalmente eliminé el javascript de la cabecera y lo puse directamente en el onclick de cada botón cambiando el texto del valor=, en lugar de cambiar la id del boton. Página 1:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Documento sin título</title>
</head>
<body>
Objeto1 <input type="submit" onClick="window.open('Untitled-2.htm?valor=objeto1','_self');" value="Realizar pedido">
<br>
Objeto2 <input type="submit" onClick="window.open('Untitled-2.htm?valor=objeto2','_self');" value="Realizar pedido">
</body>
</html> Página 2
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Documento sin título</title>
<script language="JavaScript" type="text/JavaScript">
function escribe_texto()
{
var valor = location.search.substring(1).split('=')[1];
document.forms.miform.mitextbox.value = valor;
}
</script>
</head>
<body onload="escribe_texto()">
<form name="miform" method="post" action="">
<select name="mitextbox" id="mitextbox">
<option selected>prueba</option>
<option>objeto1</option>
<option>objeto2</option>
</select>
</form>
</body>
</html> |