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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using css to style text fields

Status
Not open for further replies.

TurboSRT4

Programmer
Nov 23, 2009
47
US
hello i have a css style applied to a text field
font-family:"comic Sans MS";
padding-left:5px;
padding-right:5px;
width:120px;
height:20px;
font-size:12px;
background-repeat:no-repeat;
border:none;
background-image: url(../../images/textField.png);
background-color: transparent;

width is 120px because thats the size of the image. however if to many characters are typed it goes right over the image.
i have size declared also in html as 15 characters. if i remove the css class the html size attributr works fine. but when the class is applied it does not. any help is appreciated thanks.
 
1. How is this related to Javascript?

2. You don't show us your textfield. You only mention that it has a size of 15 characters.

The size property only determines how many characters the field can display, it doesn't limit the length of the text inside it in any way.

Perhaps using the maxlength property in conjunction with the size property may be what your after.
Code:
<input type=text size=15 maxlength=15>
If its not, perhaps posting in forum215 may be a better choice.

----------------------------------
Phil AKA Vacunita
----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top