By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,724 Members | 1,655 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,724 IT Pros & Developers. It's quick & easy.

Can I set the width of my textbook to be this long, but no longer?

P: n/a
Hi,

Say I have this textbox

<input "readonly" type="text" class="productName" value="<!-- could be
anything here -->" id="Name1" name="Name1">

How (if at all) can I define the class "productName" to make the width
of the textbox long enough to display all of the value of the textbox,
but then not take up any unnecessary space? For example, setting
width=100% may create a lot of extra space.

THanks, - Dave

Jan 31 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Scripsit la***********@zipmail.com:
Say I have this textbox
In your Subject you called it textbook. Please type more carefully in
future.
<input "readonly" type="text" class="productName" value="<!-- could be
anything here -->" id="Name1" name="Name1">

How (if at all) can I define the class "productName" to make the width
of the textbox long enough to display all of the value of the textbox,
but then not take up any unnecessary space?
Hardly. Form fields are typically implemented by system routines that have
idiosyncratic features that might be immune to any CSS code.

But why would you use such an element in the first place? If it's static
data to be included into the form set and to be shown to the user, express
this separately, e.g.

<span class="productName">foo bar</span>
<input type="hidden" name="Name1" value="foo bar">

You can then style the <spanas desired (or leave it unstyled - by default,
it occupies its natural width automatically).

--
Jukka K. Korpela ("Yucca")
http://www.cs.tut.fi/~jkorpela/

Feb 1 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.