|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
hiding and showing a div tag
I want to hide and show this DIV tag using a function up in a script and when you click on the selected index a person whether that person has a fax number or not it will show the div if they dont and hide the div if they do. any ideas?
|
|
#2
|
|||
|
|||
|
RE: hiding and showing a div tag
Only that you use php to echo the DIV if the condition is met (this means that the page needs to load itself back in when the index is clicked)
J |
|
#3
|
|||
|
|||
|
RE: hiding and showing a div tag
Something like this:
<script> function swap(ctrl) { if (ctrl.style.display == 'none') { ctrl.style.display = ''; } else { ctrl.style.display = 'none'; } </script> <a onClick="swap(div)">click me</a> <div name="div">foo</div> |
|
#4
|
|||
|
|||
|
RE: hiding and showing a div tag
Tried this and I get a 'div' is undefined, so I changed the line:
<a onClick="swap(div)">click me</a> to <a onClick="swap('div')">click me</a> and I get another error: 'style.display' is null or not an object and it doesn't matter if I assign a style sheet display:none within the div tag (although foo does become invisible obviously). what am I doing wrong?! |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > hiding and showing a div tag |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|