Solved

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

Posted on 2009-06-30
3
433 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Hta File displays dynamic File names 4 65
HTML editor custom button 3 83
How does this modal gets closed? 6 38
Sticking text to shapes in Raphael.js 6 37
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article discusses how to create an extensible mechanism for linked drop downs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. 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.: (CODE)
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…

738 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