Una Form con dei campi che possono essere visualizzati o meno in base alle esigenze.
¤ Clicca qui per visualizzare la demo... ¤
<html>
<head>
</head>
<body>
<span id="divt1" style="visibility:visible; position:relative; top:0; left:0">
<form action="javascript:#">
Type 1 Input:
<input name="t1" type="text" value="">
</form>
</span>
<span id="divt2" style="visibility:visible; position:relative; top:0; left:0;">
<form action="javascript:#">
Type 2 Input:
<input name="t2" type="text" value="">
</form>
</span>
<form>
Type 1 Visible
<input name="r1" type="radio" checked value="" onClick="toggleT('divt1','s')">
Hidden
<input name="r1" type="radio" value="" onClick="toggleT('divt1','h')"><br>
Type 2 Visible
<input name="r2" type="radio" checked value="" onClick="toggleT('divt2','s')">
Hidden
<input name="r2" type="radio" value="" onClick="toggleT('divt2','h')">
</form>
<script type=text/javascript>
function toggleT(_w,_h)
{
if (document.all)
{
if (_h == 's') eval("document.all." + _w + ".style.visibility='visible';");
if (_h == 'h') eval("document.all." + _w + ".style.visibility='hidden';");
}
else
{
if (_h == 's') eval("document.layers['" + _w + "'].visibility='show';");
if (_h == 'h') eval("document.layers['" + _w + "'].visibility='hide';");
}
}
</script>
</body>
</html>
Scarica il Codice...
Stampa la pagina