Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

show/hide DIV based on checkbox click

Posted on 2010-11-10
3
Medium Priority
?
641 Views
Last Modified: 2012-05-10
I have a checkbox in my form. If the checkbox is checked, I need to show a div tag. If it is unchecked, I need to hide the div tag.

Please help.

0
Comment
Question by:sshivanna
[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 2

Author Comment

by:sshivanna
ID: 34103810
sorry, I need to accomplish this using Jqeury.
Thank you
0
 
LVL 15

Accepted Solution

by:
Insoftservice earned 1000 total points
ID: 34103891
Hi,
I hope u have only one chk box.

<input type="checkbox" name="foo" value="bar" />

var value =  $('input[name=foo]').is(':checked') // to check whether its true or false 1st method
var value = $('input[name=foo]').attr('checked') // to check whether its true or false 2nd method
if(value ==true){
$('#divid').show();
}
else{
$('#divid').show();
}
0
 
LVL 2

Author Comment

by:sshivanna
ID: 34105109
Thank you, the idea worked. I didn't realize that I can use a combo of javascript and jquery.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

An overview of cyber security, cyber crime, and personal protection against hackers. Includes a brief summary of the Equifax breach and why everyone should be aware of it. Other subjects include: how cyber security has failed to advance with technol…
Let's take a look into the basics of ransomware—how it spreads, how it can hurt us, and why a disaster recovery plan is important.
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…

610 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