Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making A Text Box Be Transparent 2

Status
Not open for further replies.

FontanaS

Programmer
May 1, 2001
357
US
Hi,

I have atextbox that I automatically assign a value depending what the user selects from a combo box on the form.

I would like to make the text box transparent and not look like a text box, but rather a label so the user does not try to edit it.

Here is the code-

<td align="center"><input type="text" size="30" maxlength="150" name="OrderNewProjNum"></td>

Any help would be greatly appreciated!
THANKS!
 
why cant you just make it disabled...like this:

<td align="center"><input type="text" size="30" maxlength="150" name="OrderNewProjNum" [red]DISABLED[/red]></td>

-DNG
 
if you need it to submit with the rest of the form but want it displayed then how about putting the value into a hidden textbox and writing the value to a plain <div> ?
 
Using CSS you can make that box look however you want, though if the user realizes it is a box they can edit the value which is why I would suggest either making a hidden field or simply reding the value straight from the combo box.

CSS Example:
Code:
<td align="center"><input type="text" size="30" maxlength="150" name="OrderNewProjNum" style="border-width: 0px;'></td>

Disabling the control will prevent the browser from sending the value when the form posts.

signature.png
 
I had the same problem last week. What I did was use the <div> DHTML tag and set it's innerHTML property using javascript. I then set a hidden form value as well so that I could pass the value to the backend. The Div looks like a label, and the hidden value can't be changed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top