By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,598 Members | 1,897 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,598 IT Pros & Developers. It's quick & easy.

Textbox/Checkbox

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a

"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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.