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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.