Solved

onClick checkbox to show and hide a div area not working when div content is large

Posted on 2009-06-30
3
431 Views
Last Modified: 2013-11-24
I been Following the question  http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_21395578.html and implemented the code in struts2 jsp page.
But the code seems to be not working ..

the div contents will be generated on the fly

Please somebody help
code is as follows
 
<script>
function comm_direct_change(checked){
     document.getElementById('direct').style.display = checked?"block":"none";
}
</script>
 
  <s:checkbox label="Symptoms" name="check1" onclick="comm_direct_change(this.checked)" />
                          <div id="sym" style="display: none;" >    <display:column property="symptoms" title="Symptoms" sortable="true" maxLength="40" style="font-family: Arial;width:100px"/>  </div>

Open in new window

0
Comment
Question by:pothireddysunil
  • 2
3 Comments
 
LVL 29

Accepted Solution

by:
David H.H.Lee earned 500 total points
ID: 24751623
Hi pothireddysunil,
>>..But the code seems to be not working ..
Do you refer correct control's ID? Should refer "sym" instead of "direct" based on the existing code here.
eg:

function comm_direct_change(checked){
     document.getElementById('sym').style.display = checked?"block":"none";
}
0
 
LVL 1

Author Comment

by:pothireddysunil
ID: 24753981
sorry ,i have the correct Id specified...but still does'nt work.
Is there any size limit condidered for this.Also i'm trying on jsp ...will it be different.I ran some samples in html they work fine...but i fail when i run this with jsp in the above case
0
 
LVL 29

Expert Comment

by:David H.H.Lee
ID: 24759895
Hi pothireddysunil,
>>..but still does'nt work.
Any error return?

>>..Is there any size limit condidered for this.
what is the size limit that you're referring here? Do you meant the <Div>'s content?

>>..I ran some samples in html they work fine...but i fail when i run this with jsp in the above case
I'm not really familiar with JSP. Probably some other event is stopping that hiding <Div> behavior on your existing flow?
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
The viewer will learn how to implement Singleton Design Pattern in Java.
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question