Autor Zpráva
nofate
Profil
Proc se nasledujuci kod nezobrazi rovnak ve vsech prohlizecech? V IE je to bajecne (pekne pod sebou), v Opere a FF to skoci jakoby do jednoho TD. Kdyby to nebylo v tabulce tak to funguje. S visibility: hidden; / visible; to funguje, ale je tam radek navic, a tak to nechci. Tak trocha to jede s display: marker; ale presto to blbne. Poradte neco, diky. Stranka s nasledujucim kodem je tady

a jeji zdrojak:

<form method="post" action="tst.html" name="form_reg_individual" id="form_reg_individual">
<table>
<tr>
<td><p>Pocet jazyku:</p></td>
<td colspan="2"><select name="number_languages" onchange="check()">
<option value="1">1</option>
<option value="2">2</option>
</select></td>
</tr>
<tr id="spokenlanguage1">
<td>Jazyk 1:</td>
<td><select name="language">
<option value="english">English</option><option value="spanish">Spanish</option>
</select>
<select name="level">
<option value="basic">Zaklady</option><option value="advanced">Vice</option>
</select>
</td>
</tr>
<tr id="spokenlanguage2" style="display: none;">
<td>Jazyk 2:</td>
<td><select name="language">
<option value="english">English</option><option value="spanish">Spanish</option>
</select>
<select name="level">
<option value="basic">Zaklady</option><option value="advanced">Vice</option>
</select>
</td>
</tr>
<script language="javascript" type="text/javascript">
function check()
{
var A = document.getElementById("form_reg_individual");
var numblang = A.number_languages.value;

if(numblang == "1")
{
document.getElementById('spokenlanguage2').style.display='none';
}

if(numblang == "2")
{
document.getElementById('spokenlanguage2').style.display='block';
}
}
check();
</script>
</table>
</form>
peta
Profil
"A.number_languages.value"
jakspatweb - javascript - priklady - select zpusobi prechod na jinou stranku

<tr id="spokenlanguage2" style="display: none;">
document.getElementById('spokenlanguage2').style.display='none'
tak to bych hadal, ze jen v IE. Mam pocit, ze tabulka jinde TR display:block nebere, ptoroze tabulka na display:table-row
nofate
Profil
TR display:block nebo none bere tabulka , a to u vsech projlizecech. Skus si tohle:

Neuvidis TR tabulky:
<table>
<tr style="display: none;">
<td>Neco:</td>
<td>Dalsi neco</td>
</tr>
</table>
<br><br>
Uvidis TR tabulky:
<table>
<tr style="display: block;">
<td>Neco:</td>
<td>Dalsi neco</td>
</tr>
</table>

... a neuvidis nic. Problem je jen vtedy kdys to TR ma zobrazit ten JS prikaz:
document.getElementById('spokenlanguage2').style.display='block'
Pak i kdys mam dvakrat TD TD tak ono to da jenom do toho prvniho a proto to na mi strance tak skoci na levou stranu .
nofate
Profil
problem je jednoznacne v prikazu document.getElementById('spokenlanguage2').style.display='block'
Updejtnul sem testovaci stranku - dal sem tam border na TABLE a taky na TD a tet je pekne videt co udela ten JS prikaz. Takze by to chtelo nejak zmenit respektive doplnit ten kone cprikazu v JS, display: table-neco nemuzu pouzit lebo IE to ignoruje
Toto téma je uzamčeno. Odpověď nelze zaslat.