Ver Mensaje Individual
  #2 (permalink)  
Antiguo 21/10/2008, 10:24
Avatar de glmarzoa
glmarzoa
 
Fecha de Ingreso: octubre-2008
Mensajes: 7
Antigüedad: 15 años, 6 meses
Puntos: 0
Respuesta: Capas superpuestas o vínculos en iframe?

Me autocontesto... Se me ocurre que en vez de usar capas, podría poner una serie de divs dentro de la tabla, que cambien en función del valor del 2º select. No me funciona lo de parametrostanques() y no se porqué, supongo que no coge bien el value del select. Alguna sugerencia o corrección?? Gracias
<html>
<head>
<script>
function cambiarteito(){
var index=document.forms.Equipos_tanques.Tipotanque.se lectedIndex;
Equipos_tanques.Subtipotanque.length=0;
if(index==0) teitofixo();
if(index==1) teitoflotante();}
function teitofixo(){
opcion0=new Option("Tanque horizontal","horizontal");
opcion1=new Option("Tanque vertical","vertical","defaultSelected");
document.forms.Equipos_tanques.Subtipotanque.optio ns[0]=opcion0;
document.forms.Equipos_tanques.Subtipotanque.optio ns[1]=opcion1;}
function teitoflotante(){
opcion0=new Option("Teito flotante interno","interno","defaultSelected");
opcion1=new Option("Teito flotante externo","externo");
opcion2=new Option("Teito flotante externo con abovedado fixo","abovedado");
document.forms.Equipos_tanques.Subtipotanque.optio ns[0]=opcion0;
document.forms.Equipos_tanques.Subtipotanque.optio ns[1]=opcion1;
document.forms.Equipos_tanques.Subtipotanque.optio ns[2]=opcion2; }
</script>
<script>
function azul(celda){
celda.style.backgroundColor='#99CCFF';}
function blanco(celda){
celda.style.backgroundColor='#FFFFFF';}
function parametrostanques(){
var indice= document.forms.Equipos_tanques.Subtipotanque.selec tedIndex;
var tipotk = document.Equipos_tanques.Subtipotanque[indice].value
if(tipotk==vertical) vertical();
if(tipotk==horizontal) horizontal();
if(tipotk==interno) interno();
if(tipotk==externo) externo();
if(tipotk==abovedado) abovedado();}
function abovedado{
c11=document.getElementById('1A');
c11.innerHTML = "&nbsp;";
blanco(c11);
c12=document.getElementById('1B');
c12.innerHTML="&nbsp;";
c21=document.getElementById('2A');
c21.innerHTML = "Selo primario";
azul(c21);
c22=document.getElementById('2B');
c22.innerHTML='<select id="TFASelo1"><option>Zapata mecánica</option><option>Montado en vapor</option><option>Montado en líquido</option></select>';
c31=document.getElementById('3A');
c31.innerHTML = "Selo secundario";
azul(c31);
c32=document.getElementById('3B');
c32.innerHTML ='<select id="TFASelo2"><option>Si</option><option >Non</option></select>';
c41=document.getElementById('4A');
c41.innerHTML ="Unións";
azul(c41);
c42=document.getElementById('4B');
c42.innerHTML ='<select id="TFAUnions"><option>Remachada</option><option>Soldada</option></select>';
c51=document.getElementById('5A');
c51.innerHTML ="Plataforma";
azul(c51);
c52=document.getElementById('5B');
c52.innerHTML ='<select id="TFAPlataforma"><option>Dobre plataforma</option><option>Con flotador</option></select>';
c61=document.getElementById('6A');
c61.innerHTML = "&nbsp;";
blanco(c61);
c62=document.getElementById('6B');
c62.innerHTML="&nbsp;";}
function externo{
c11=document.getElementById('1A');
c11.innerHTML = "&nbsp;";
blanco(c11);
c12=document.getElementById('1B');
c12.innerHTML="&nbsp;";
c21=document.getElementById('2A');
c21.innerHTML = "Selo primario";
azul(c21);
c22=document.getElementById('2B');
c22.innerHTML='<select id="TFESelo1"><option>Zapata mecánica</option><option>Montado en vapor</option><option>Montado en líquido</option></select>';
c31=document.getElementById('3A');
c31.innerHTML = "Selo secundario";
azul(c31);
c32=document.getElementById('3B');
c32.innerHTML ='<select id="TFESelo2"><option>Si</option><option >Non</option></select>';
c41=document.getElementById('4A');
c41.innerHTML ="Unións";
azul(c41);
c42=document.getElementById('4B');
c42.innerHTML ='<select id="TFEUnions"><option>Remachada</option><option>Soldada</option></select>';
c51=document.getElementById('5A');
c51.innerHTML ="Plataforma";
azul(c51);
c52=document.getElementById('5B');
c52.innerHTML ='<select id="TFEPlataforma"><option>Dobre plataforma</option><option>Con flotador</option></select>';
c61=document.getElementById('6A');
c61.innerHTML = "&nbsp;";
blanco(c61);
c62=document.getElementById('6B');
c62.innerHTML="&nbsp;";}
function interno(){
c11=document.getElementById('1A');
c11.innerHTML = "Teito Autosoportado";
azul(c11);
c12=document.getElementById('1B');
c12.innerHTML='<select id="Autosoporte"><option>Si</option><option >Non</option></select>';
c21=document.getElementById('2A');
c21.innerHTML = "Nº de columnas";
azul(c21);
c22=document.getElementById('2B');
c22.innerHTML='<input type="text" id="Ncolumnas" size="5"/>'
c31=document.getElementById('3A');
c31.innerHTML = "Diámetro das columnas";
azul(c31);
c32=document.getElementById('3B');
c32.innerHTML ='<input type="text" id="Dcolumnas" size="5"/>&nbsp;m'
c41=document.getElementById('4A');
c41.innerHTML ="Selo Primario";
azul(c41);
c42=document.getElementById('4B');
c42.innerHTML ='<select id="TFISelo1"><option>Zapata mecánica</option><option>Montado en vapor</option><option>Montado en líquido</option></select>';
c51=document.getElementById('5A');
c51.innerHTML ="Selo secundario";
azul(c51);
c52=document.getElementById('5B');
c52.innerHTML ='<select id="TFISelo2"><option>Si</option><option >Non</option></select>';
c61=document.getElementById('6A');
c61.innerHTML = "Unións";
azul(c61);
c62=document.getElementById('6B');
c62.innerHTML='<select id="TFIUnions"><option>Con pernos</option><option>Soldada</option></select>';}
function horizontal(){
c11=document.getElementById('1A');
c11.innerHTML = "&nbsp;";
blanco(c11);
c12=document.getElementById('1B');
c12.innerHTML="&nbsp;";
blanco(c12);
c21=document.getElementById('2A');
c21.innerHTML = "Calefactado";
azul(c21);
c22=document.getElementById('2B');
c22.innerHTML='<select id="Tqhoriz_calef"><option>Si</option><option >Non</option></select>'
c31=document.getElementById('3A');
c31.innerHTML = "&nbsp;";
blanco(c31);
c32=document.getElementById('3B');
c32.innerHTML ="&nbsp;";
c41=document.getElementById('4A');
c41.innerHTML ="Subterr&aacute;neo";
azul(c41);
c42=document.getElementById('4B');
c42.innerHTML ='<select id="Tqhoriz_subterr"><option>Si</option><option >Non</option></select>';
c51=document.getElementById('5A');
c51.innerHTML ="&nbsp;";
blanco(c51);
c52=document.getElementById('5B');
c52.innerHTML ="&nbsp;";
c61=document.getElementById('6A');
c61.innerHTML = "&nbsp;";
blanco(c61);
c62=document.getElementById('6B');
c62.innerHTML="&nbsp;"; }
function vertical(){
c11=document.getElementById('1A');
c11.innerHTML = "&nbsp;";
blanco(c11);
c12=document.getElementById('1B');
c12.innerHTML="&nbsp;";
blanco(c12);
c21=document.getElementById('2A');
c21.innerHTML = "Calefactado";
azul(c21);
c22=document.getElementById('2B');
c22.innerHTML='<select id="Tqvertical_calefacción"><option>Si</option><option >Non</option></select>'
c31=document.getElementById('3A');
c31.innerHTML = "Altura máx líquido";
azul(c31);
c32=document.getElementById('3B');
c32.innerHTML ='<input type="text" id="Hmax" size="5"/>&nbsp;m';
c41=document.getElementById('4A');
c41.innerHTML ="Altura media líquido";
azul(c41);
c42=document.getElementById('4B');
c42.innerHTML ='<input type="text" id="Hmed" size="5"/>&nbsp;m';
c51=document.getElementById('5A');
c51.innerHTML ="Altura do teito";
azul(c51);
c52=document.getElementById('5B');
c52.innerHTML ='<input type="text" id="Hteito" size="5"/>&nbsp;m';
c61=document.getElementById('6A');
c61.innerHTML = "&nbsp;";
blanco(c61);
c62=document.getElementById('6B');
c62.innerHTML="&nbsp;";}
</script>
</head>
<body>
<form id="Equipos_tanques">
<table width="82%" border="1">
<tr><td colspan="6"><div><span>Tanque de Almacenamento </span></div></td> </tr>
<tr><td width="9%"><div>IDT</div></td>
<td width="10%"><span>
<input type="text" id="ID tanque1" size="15" />
</span></td>
<td colspan="2"><div><span>Tipo de tanque </span></div></td>
<td colspan="2" ><div>Par&aacute;metros espec&iacute;ficos</div></td></tr>
<tr><td><span>Producto </span></td>
<td><input type="text" id="Prod tanque1" size="15" /></td>
<td width="18%" rowspan="3"><div>
<select id="Tipotanque" onchange="cambiarteito()">
<option value="Teitofixo">Teito fixo</option>
<option value="Teitoflotante">Teito flotante</option>
</select></div></td>
<td width="20%" rowspan="3"><div>
<select id="Subtipotanque" onchange="parametrostanques()">
<option value="horizontal">Tanque horizontal</option>
<option value="vertical">Tanque vertical</option>
</select></div></td>
<td width="15%"><div id="1A"></div></td>
<td width="28%"><div id="1B"></div></td> </tr>
<tr> <td><span>Densidade </span></td>
<td><span> <input type="text" id="Dens_tq1" size="8" /></span></td>
<td><div id="2A" >Calefactado</div></td>
<td><div id="2B"><select id="Horiz_calef">
<option>Si</option>
<option >No</option></select></div></td></tr>
<tr><td><span>Di&aacute;metro</span></td>
<td><span><input type="text" id="Diametro_tk1" size="10" /> m</span></td>
<td><div id="3A"></div></td>
<td> <div div id="3B"></div></td></tr>
<tr><td><div>Dimensi&oacute;n caracter&iacute;stica </div></td>
<td><span><input type="text" id="Dimcaract_tk1" size="10" /> m </span></td>
<td colspan="2" rowspan="3" </td>
<td><div id="4A">Subterr&aacute;neo</div></td>
<td><div id="4B">
<select id="Tk subterr&aacute;neo">
<option>Si</option>
<option >No</option> </select> </div></td></tr>
<tr> <td><span>Volume &uacute;til </span></td>
<td><span><input type="text" id="Vol_util1" size="10" /></span></td>
<td><div id="5A"></div></td>
<td> <div id="5B"></div></td></tr>
<tr> <td><div>Rotaci&oacute;ns</div></td>
<td><input type="text" id="Rotaci&oacute;ns1" size="15" /></td>
<td><div id="6A"></div></td>
<td><div div id="6B"></div></td></tr>
<tr> <td height="37" colspan="6"><span></span><span></span></td></tr>
</table></form></body></html>