Forum Moderators: open

Message Too Old, No Replies

Hide and To show Table

         

romzinho2k7

6:31 am on Apr 13, 2006 (gmt 0)

10+ Year Member



Hey friends, all right?

I am with a new problem. I want to put a hidden table in the site and if the user clicked in ' Show Table ' would be shown the table with the option. I did a script simple, however how I wanted... It did not want to use in the HTML "type=radio", wanted it stayed as a link. ( Show Table ) <- Only that in the link. And when the user clicked, it showed the options and if it clicked again, hide the options.

That script that I did has another problem. He does not work on Firefox.
----[HTML + Script]-----------------------------------

<table border="0" cellspacing="1" align="center" width="95%">
<script language="javascript">
function show(item){
item.style.display='';
}

function hide(item){
item.style.display='none'
}
</script>
<tr>
<td align="right" width="27%"><font size="1" face="Verdana" color="#FF0000"><b>Type:</b></font></td>
<td width="73%"><font face="verdana" size="1"> <span id="sim" onClick="show(hidden)">
<input type="radio" name="work" value="E">
</span>Company <span id="nao" onClick="hide(hidden)">
<input type="radio" name="work" value="A" checked>
</span>Freelance Professional </td>
</tr>
<tr id="hidden" style="display:'none'">
<td align="right" width="27%"><font size="1" face="Verdana" color="#FF0000"><b>Number:</b></font></td>
<td width="73%"><input type="text" name="doc" size="20" tabindex="4">
<font face="verdana" size="1"> (Only 14 numbers) </font></td>
</tr>
</table>

----[HTML + Script]-----------------------------------

Will it it be what anybody could help?

Thank you very much at once!

kaled

11:56 am on Apr 13, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This is what I use...


<a href="#" onclick="toggleDisplay(IDtable); return false;">toggle</a>

<script [b]type="text/javascript"[/b]>
function toggleDisplay(id)
{ with (document.getElementById(id).style) {
if (display == "none")
display = ""
else display = "none";
}}
</script>

Kaled.

romzinho2k7

8:44 pm on Apr 13, 2006 (gmt 0)

10+ Year Member



OK, worked! =)

Kind, he would have how to do it do to the table start hides? And it only appeared if had the user click?

Thanks