Hi, I have one image that I want to expand/show or collapse/hide some text boxes, labels of <td>, and button such as reset and submit. Can anyone help me please? Thanks.
I enclose part of my code below. As you can see, I have a form which will take some data from the text boxes. If the user needs to add data, they will click on the image below test.gif to expand the text and text box. If not, the text and text box and submit/reset buttons will stay hidden. Can you let me know where to insert the code you mention into my code? Thanks.
add the function within the head tags:
<head>
<script type="text/javascript">
<!--
function hide(e,v){
document.getelementbyid(e).style.visibility = v
}
//-->
</script>
Hi Simon, many thanks. However, I still get an error message:
A Runtime Error occurred.
Line: 0
Error: Object expected.
Microsoft Script Editor points the error to this line:
<HTML><SCRIPT LANGUAGE=javascript>var __w=hide('myTable','visible');if(__w!=null)document.write(__w);
What does it mean? And why does the script open a new window to show the table (with the address: javascript:hide('myTable','visible') vid:1-1), NOT on the same page where the image located?
Hi Simon, still the same error. I'm trying to have the image to show or hide table together with its contents, based on the code above, the screen will look like this more or less:
Add Data (Image test.gif is here)
Name (txtName text box is here)
So when the user clicks test.gif image, then Name and txtName text box will be shown or hidden.
Hi Simon, I still get the same error message. I've changed the code using div instead for all objects inside a form and it seems to work fine. However, does not work in Netscape 7.1 for the following codes:
What's the point in me suggesting something when you are going to do something else anyway - post some code, I dont have time to waste trying to figure out what you are trying to do.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.