Input border

liunx

Guest
I have an input box (type="text") that I want to use as a label so I can hide it when I need to. Is there a way to turn off the border around the box?<br />
<br />
tia,<br />
cami<!--content-->Better yet, why not just get rid of it all together? Here's an example, copy and paste the code to see it in action:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><br />
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><br />
<head><br />
<title>Show/Hide Testbox</title><br />
<script type="text/javascript"><br />
function showHide(element)<br />
{<br />
element = document.getElementByID(element);<br />
if(element.style.display != "none")<br />
{<br />
element.style.display = "none";<br />
}<br />
else<br />
{<br />
element.style.display = "inline";<br />
}<br />
}<br />
</script><br />
</head><br />
<body><br />
<br />
<fieldset><br />
<input type="text" id="showhideme" /><br />
<input type="button" onclick="showHide('showhideme')" value="Show/Hide the textbox" /><br />
</fieldset><br />
<br />
</body><br />
</html><br />
NOTE: This shouldn't be used when it is absolutely necessary that the box be hidden, as not everyone has JavaScript support.<!--content-->I think he was talking about borders, so i altered your example slightly:<br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><br />
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"><br />
<head><br />
<title>What Dan Meant To Say</title><br />
<style type="text/css"><br />
#showhideme{border:0 none;}<br />
#showhideme:focus, #showhideme:active{border:1px inset #999}<br />
</style><br />
</head><br />
<body><br />
<br />
<fieldset><br />
<input type="text" id="showhideme" value="the text inside" /><br />
</fieldset><br />
</body><br />
</html><br />
<br />
entirely untested, but should work(in browsers).<!--content-->This application is inherited and doesn't have a stylesheet associated and right now the fix doesn't warrant trying to attach one and figure out the things that go wrong when applied. I figured out something that does work however.<br />
<br />
<---code begins---><br />
<input type="Text" name="PrimaryApprLabel" value="Primary Approver" align="right" readonly style="border:0 none;"><br />
<---code ends---><br />
<br />
thanks for the input<br />
<br />
:D <br />
cami<!--content-->
 
Back
Top