Link to home
Start Free TrialLog in
Avatar of irish_paddy
irish_paddy

asked on

how to adjust the size of a textbox??

hi, How do i edit a the size of a text box in HTML?
Thanks...
Avatar of lj8866
lj8866

<TEXTAREA NAME="name_goes_here"
ROWS=40 COLS=65 WRAP=physical></TEXTAREA>

for a text area


<INPUT TYPE="text" NAME="name_goes_here" Size=80>

for a text box

Hope that helps.
or use CSS:

inline:
<input type="text" name="myText" style="width:250px">

style sheet:

<!-- goes in the head tags -->
<style>
    .data {
        width:250px;
    }
</style>

<input type="text" name="myText" class="data">
also, the height of the textbox will change depending on the font type and font size in the textbox

you can do this:

<input type="text" style="font-family:verdana; font-size:14;">
ASKER CERTIFIED SOLUTION
Avatar of umangjoshi
umangjoshi

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The maxlength attribute will stop users typing in too much to your textbox as well, so, say you wanted to have a field for date input and you wanted the textbox to be a certain size to match others on the page, but didn't want people to type tons of stuff, you could use the follwing:

<form>
  <input type="text" name="txtboxname" size="15" maxlength="10" />
  <input type="submit" />
</form>

10 characters would allow nothing greater than, for example, 26/04/2003 to be entered.  Obviously, where a date is concerned, lots more checking is required :) but maxlength is a good start and can help prevent long SQL injection attacks from people trying to type in too much into your txtbox trying to add stuff to SQL statements embedded in your code.
This question has been classified abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.

<note>
Unless it is clear to me that the question has been answered I will recommend delete.  It is possible that a Grade less than A will be given if no expert makes a case for an A grade. It is assumed that any participant not responding to this request is no longer interested in its final disposition.
</note>

If the user does not know how to close the question, the options are here:
https://www.experts-exchange.com/help/closing.jsp


Cd&

It is time to clean this abandoned question up.

I am putting it on a clean up list for CS.

<recommendation>
points to umangjoshi

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&