Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2703
  • Last Modified:

how to adjust the size of a textbox??

hi, How do i edit a the size of a text box in HTML?
Thanks...
0
irish_paddy
Asked:
irish_paddy
1 Solution
 
lj8866Commented:
<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.
0
 
thomasdoddsCommented:
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">
0
 
vitanzaCommented:
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;">
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
umangjoshiCommented:
pls try following html

<body>
  <form name="frm">
    <input type="text" name="txt" size="10">
    <input type="button" name="b1" value="size 20" onClick="frm.txt.size = 20;">
    <input type="button" name="b2" value="size 10" onClick="frm.txt.size = 10;">
  </form>
</body>
0
 
Adam_JCommented:
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.
0
 
COBOLdinosaurCommented:
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:
http://www.experts-exchange.com/help/closing.jsp


Cd&

0
 
COBOLdinosaurCommented:
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&

0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now