473,396 Members | 1,754 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Textbox/Checkbox

Hello all,

I have a form with a checkbox labeled other. I want to make it so if
the user clicks "other" a textbox appears right next to it allowing
them to fill in their value. If the other checkbox is unchecked, the
box disappears. Is this possible with Javascript? If so how would I go
about implementing this??

thanks in advance,
Mike
Jul 20 '05 #1
2 4961

"Mike" <ma******@hotmail.com> schreef in bericht
news:72*************************@posting.google.co m...
Hello all,

I have a form with a checkbox labeled other. I want to make it so if
the user clicks "other" a textbox appears right next to it allowing
them to fill in their value. If the other checkbox is unchecked, the
box disappears. Is this possible with Javascript? If so how would I go
about implementing this??


<form>
<input type="checkbox" name="checkbox"
onclick="form.textbox.style.display=checked?'':'no ne'" />
<input style="display:none" type="text" name="textbox" />
</form>
JW

Jul 20 '05 #2
ma******@hotmail.com (Mike) writes:
Hello all,

I have a form with a checkbox labeled other. I want to make it so if
the user clicks "other" a textbox appears right next to it allowing
them to fill in their value. If the other checkbox is unchecked, the
box disappears. Is this possible with Javascript? If so how would I go
about implementing this??


<input type="checkbox"
onclick="document.getElementById('textField').styl e.visibility =
this.checked?'visible':'hidden';">
<input type="text" id="textField" style="visibility:hidden;">

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Gary | last post by:
Hello, Is it possible to dynamically update a textbox with words chosen from a list using form checkboxes and javascript? Gary
0
by: mahsa | last post by:
Hi i want to add checkbox and textbox dynamicly I use this for check box but it has erro CheckBox box = new CheckBox() this.box.CheckedChanged += new System.EventHandler(this.box_CheckedChanged)...
4
by: GMK | last post by:
dear all i'm building an asp.net application i have on one of my pages a checkbox i want that whenever the user checkd the checkbox to enable a textbox and when the user uncheck the checkbox the...
7
by: I am Sam | last post by:
I have a DataGrid that is passing information to a stored procedure properly but the parameters aren't being casted properly. I was woundering if anyone can tell me how I should properly cast the...
3
by: Justin Morris via DotNetMonster.com | last post by:
<asp:TextBox ID="TextBox1" runat="server" value='<%=Server.HtmlEncode (Request.Cookies("Username")("Username"))%>'/> <input name="Password" type="text" id="Password" value='<%...
1
by: bird | last post by:
Greetings, I'm trying to calculate the total on an php page. I'm able to get the checkbox portion to work properly but I'm having trouble with the textbox "txtshipping". The default is 7.95...
6
by: Brandon McCombs | last post by:
Hello, I have a Form that contains some configuration information. One of the settings is for SSL. There is a checkbox that I want to check to make 2 textboxes un-editable so that a user can...
2
by: sammiesue | last post by:
Hi, I have form with 2 autosummed textboxes ("total" and "casinototal"). I would like to have a grand total textbox ("grandtotal") get its value from summing "total" and "casinototal", but it...
1
by: =?Utf-8?B?R2lkaQ==?= | last post by:
Hi, I've a webPage, which has a checkbox. i want that when the checkbox is checked, a textbox will be created and showen under the checkbox. How can i do it? Thanks, Gidi.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.