Solved

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

Posted on 2009-06-30
3
434 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

Salesforce Has Never Been Easier

Improve and reinforce salesforce training & adoption using WalkMe's digital adoption platform. Start saving on costly employee training by creating fast intuitive Walk-Thrus for Salesforce. Claim your Free Account Now

Question has a verified solution.

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

Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
This article discusses how to implement server side field validation and display customized error messages to the client.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
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)

717 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