Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How to make a checkbox make a text field appear right away after clicking it with a check?

Posted on 2006-04-18
3
Medium Priority
?
190 Views
Last Modified: 2010-04-06
What I am trying to do is make a checkbox on my webpage that if you click it to put a check in the box it will have a text form appear.
0
Comment
Question by:lhaluska
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
smaccari earned 2000 total points
ID: 16482811
You can do like this:

<input type="checkbox" onclick="document.getElementById('textToShow').style.display=(this.checked)?'':'none'"/>
<br/>
<input type="text" id="textToShow" name="textToShow" style="display:none"/>
0
 
LVL 1

Author Comment

by:lhaluska
ID: 16482887
Thank you very much it works great..
0
 
LVL 9

Expert Comment

by:smaccari
ID: 16482898
Welcome :)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Suggested Courses

577 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