?
Solved

hide/un-hide section (on check/un-check checkbox)

Posted on 2005-03-22
3
Medium Priority
?
520 Views
Last Modified: 2012-05-05
I have a list of checkboxes that asking users for input, the last one will be "Others" - when users selected this checkbox, it'll show another textarea so they can type in some text ... when they un-checked the box, the textarea should be disappear.

<form action = "test.asp" method="post">
   <input type="checkbox" name="name1" value="value1"> Value1
   <input type="checkbox" name="name2" value="value2"> Value2
   <input type="checkbox" name="name3" value="others"> Others
    below will be shown only when user selected "Others", disappear when uncheck.
    <textarea name="text2Enter" rows="3" cols="30"></textarea>

</form>

Please help :) thank you very much,
0
Comment
Question by:tlp560
[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 32

Accepted Solution

by:
Batalf earned 200 total points
ID: 13601349
<form action = "test.asp" method="post">
   <input type="checkbox" name="name1" value="value1"> Value1
   <input type="checkbox" name="name2" value="value2"> Value2
   <input type="checkbox" name="name3" value="others" onclick="document.getElementById('text2Enter').style.display=(this.checked?'inline':'none')"> Others
    below will be shown only when user selected "Others", disappear when uncheck.<br>
    <textarea style="display:none" id="text2Enter" name="text2Enter" rows="3" cols="30"></textarea>

</form>
0
 
LVL 6

Expert Comment

by:wimthepimscake
ID: 13601781
or <input type="checkbox" name="name3" value="others" onclick="document.getElementById('text2Enter').style.display=(this.checked?'blocked':'none')">
0
 
LVL 32

Expert Comment

by:Batalf
ID: 13601796
you probably mean "block" and not "blocked"!?
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…
Suggested Courses

801 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