Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/10/2003, 10:00
Avatar de affv
affv
 
Fecha de Ingreso: diciembre-2002
Ubicación: Ahora aqui
Mensajes: 485
Antigüedad: 22 años, 2 meses
Puntos: 0
Combo,Combo,Textbox

ok vean este codigo

<script language="JavaScript">

var Combo2 = false;
var Textbox = false;


function cambiaCategoria(){
with (window.pantalla.document){
Combo2 = (MyForm.Categoria.selectedIndex == 1? true: false);
Textbox = (MyForm.Categoria.selectedIndex == 2? true: false);
}
formulario();
}

function formulario(){
with (window.pantalla.document){
open();
writeln("<html>\n<body>");
writeln("<form name='MyForm'>");
writeln("<select name='Categoria' onchange='parent.cambiaCategoria()'>");
writeln(" <option selected>Opciones</option>");
writeln(" <option" + (Combo2? " selected": "") + ">Combo2</option>");
writeln(" <option" + (Textbox? " selected": "") + ">Textbox</option>");
writeln("</select>");
writeln("<br><br>");
if (Combo2){
writeln("<select size='1' name='Lugar'>");
writeln("<option selected>Opcion1</option>");
writeln("<option>Opcion2</option>");
writeln("</select><br><br>");
}
if (Textbox){
writeln("<input type='text' name='Lugar'><br><br>");
}
writeln("<input type='submit' value='Enviar'>");
writeln("<br>");
writeln("</form>");
writeln("</body>\n</html>");
close();
}
}


document.writeln("<frameset rows='100%,*' onload='javascript:parent.formulario()'>");
document.writeln(" <frame name='pantalla' src=''>");
document.writeln(" <frame src=''>");
document.writeln("</frameset>");

</script>

El codigo funciona bien justo como quiero pero el problema es que lo hace en un frame como puedo hacer para que lo haga en la misma pagina en la que pongo el codigo sin que cree el frame
__________________
Todo tiene un comienzo y un fin!!
Postea tus proyectos