Jump to content

Default set to no show


jandrews3

Recommended Posts

I got the following code to work on a page to hide or toggle showing a particular table by clicking a button. BUT, I want the initial setting to be to HIDE the table. Only by clicking the button do I want it to show the table. The script works great except that on load, the table shows. You have to click the button to hide it. I want it to hide the table by default without clicking. I'm sure this is an easy solution, but I know next to nothing about javascript. THANKS!!!

<script type="text/javascript">
    function displayRow(){
        var row = document.getElementById("captionRow");
if (row.style.display == '')  row.style.display = 'none';
else row.style.display = '';
    }
</script>

<input type="button" onclick="displayRow()" style="margin-left: 10px;">Add links to this paragraph:
<table width="600" border="0" style="font-size: 9pt; margin-left: 10px;">
<tr id="captionRow">
<td>
Page text:<input type="text" name="embedT<?print $lcount?>" /><br />
Page text:<input type="text" name="embedT<?print $lcount?>" /><br />
Page text:<input type="text" name="embedT<?print $lcount?>" /><br />
</td>
<td>
Link address:<input type="text" name="embedT<?print $lcount?>" value="http://www."/><br />
Link address:<input type="text" name="embedT<?print $lcount?>" value="http://www."/><br />
Link address:<input type="text" name="embedT<?print $lcount?>" value="http://www."/><br />
</td>
</tr>
</table>

Link to comment
https://forums.phpfreaks.com/topic/215583-default-set-to-no-show/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.