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

easy question about form object text boxes

Status
Not open for further replies.

chaddu1256

IS-IT--Management
Jan 13, 2003
28
0
0
US
I have a text field on my page and I was wondering how you go about changing the size of the field. Everytime I insert a text field they are all teh same size.

The code for the text field right now is

<input type="text" name="cvv2" value="">

Any help would be appreciated
 
One way would be:
Code:
<html>
<body>
<input type="text" name="cvv2" value="" [b]style="width:300;"[/b]>
</body>
</html>


buffalo.gif height="65" width="35"

 
And if you'd like all your inputs to be like that, you can do this:

Code:
<html>
<head>
<style type="text/css">
input{
    width:150px;
}
</style>
</head>
<body>
<input type="text" name="cvv2" value="">
</body>
</html>

Note that doing that will affect ALL your inputs, not just text inputs. <input type="submit">, <input type="radio">, etc. will all be affected.

To change only text inputs, you'll have to use a class because the css method for only text inputs isn't stable yet...

Code:
<html>
<head>
<style type="text/css">
.bi input{
    width:150px;
}
</style>
</head>
<body>
<input type="text" name="cvv1" value="">
<input type="text" name="cvv2" value="" class="bi">
<input type="text" name="cvv3" value="" class="bi">
<input type="text" name="cvv4" value="">
</body>
</html>

Play around and get what you like. You can change more than just the width, if you want to.

Rick

 
Thanx for the info you two. I got what I need now, so I appreciate it alot.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top