Richard Korts
asked on
Text Box size
In an HTML form when using input type="text", I want the size to be very small.
When I put size="1", it still allows 4 or 5 characters to be typed into the box.
Is there any way to make it smaller in width than size="1"?
I relaize that maxlength can limit the number of characters typed in. It's more the width on the form that is sometimes an issue.
When I put size="1", it still allows 4 or 5 characters to be typed into the box.
Is there any way to make it smaller in width than size="1"?
I relaize that maxlength can limit the number of characters typed in. It's more the width on the form that is sometimes an issue.
ASKER
To VoteyDisciple,
Can you be more specific? I don't understand what you mean. I need to see both the stylesheet code AND the <input type....> code.
Please gove me a specific example.
Thanks
Can you be more specific? I don't understand what you mean. I need to see both the stylesheet code AND the <input type....> code.
Please gove me a specific example.
Thanks
HTML:
<input type="text" name="whatever_name" class="whatever" />
CSS:
input.whatever {
width: 1em;
}
<input type="text" name="whatever_name" class="whatever" />
CSS:
input.whatever {
width: 1em;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Use maxlength if you want to limit numbers of characters.
<input type="text" size="1" maxlength = "1" style="width: 1em;" />
<input type="text" size="1" maxlength = "1" style="width: 1em;" />
<input type="text" name="txtTest" style="width: 1em;" />
input.whatever {
width: 1em;
}
... (adjusting the width to something you like) is all you'd need.