?
Solved

how to adjust the size of a textbox??

Posted on 2003-03-20
7
Medium Priority
?
2,697 Views
Last Modified: 2010-05-19
hi, How do i edit a the size of a text box in HTML?
Thanks...
0
Comment
Question by:irish_paddy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 

Expert Comment

by:lj8866
ID: 8177124
<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
 
LVL 6

Expert Comment

by:thomasdodds
ID: 8177781
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
 

Expert Comment

by:vitanza
ID: 8178784
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
WordPress Tutorial 3: Plugins, Themes, and Widgets

The three most common changes you will make to your website involve the look (themes), the functionality (plugins), and modular elements (widgets).

In this article we will briefly define each again, and give you directions on how to install them.

 
LVL 1

Accepted Solution

by:
umangjoshi earned 80 total points
ID: 8230375
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
 

Expert Comment

by:Adam_J
ID: 8400472
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
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 8820577
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
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 9015793
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

WordPress Tutorial 1: Installation & Setup

WordPress is a very popular option for running your web site and can be used to get your content online quickly for the world to see. This guide will walk you through installing the WordPress server software and the initial setup process.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Building a website can seem like a daunting task to the uninitiated but it really only requires knowledge of two basic languages: HTML and CSS.
Originally, this post was published on Monitis Blog, you can check it here . Websites are getting bigger and more complicated by the day. Video, images and custom fonts are all great for showcasing your product or service. But the price to pay in…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…
Suggested Courses

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question