I need the code that will show a text field if i clicked on the button ...
Javascript
Collapse
X
-
A simple google search turned up with this link
In case you don't know where to look on that page, I'll paste the code onto here
The HTML for the text fieldCode:<script language=javascript type='text/javascript'> function hideField() { if (document.getElementById) { // DOM3 = IE5, NS6 document.getElementById('textField').style.visibility = 'hidden'; } else { if (document.layers) { // Netscape 4 document.textField.visibility = 'hidden'; } else { // IE 4 document.all.textField.style.visibility = 'hidden'; } } } function showField() { if (document.getElementById) { // DOM3 = IE5, NS6 document.getElementById('textField').style.visibility = 'visible'; } else { if (document.layers) { // Netscape 4 document.textField.visibility = 'visible'; } else { // IE 4 document.all.textField.style.visibility = 'visible'; } } } </script>
And the buttonsCode:<input type="text" id="textField" />
Code:<input type="button" id="showField" onclick="showField()" /> <input type="button" id="hideField" onclick="hideField()" />
-
If you are asking "How do I make a text field invisible upon the page loading?" then instead of a plain <body> tag, use <body onload="hideFie ld()">
If your not asking that, and your asking "How do I make a text field disappear when I press the button" use the code I gave you above
<input type="button" id="hideField" onclick="hideFi eld()" />Comment
Comment