?
Solved

Top Alignment in a Textbox

Posted on 2013-06-12
15
Medium Priority
?
249 Views
Last Modified: 2013-06-12
I have a text input field in a form.  I want the type to align top left.  Now its in the middle left.  How can I fix that?

<td><input name="item4" type="text" class="FreeForm" valign="top" id="item4" value="Type Your Order Here" size="200" />

Open in new window

0
Comment
Question by:DS928
[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
  • 4
  • 4
  • 4
  • +2
15 Comments
 
LVL 58

Expert Comment

by:Gary
ID: 39241799
Do you mean like this
http://jsfiddle.net/8PVdh/
0
 
LVL 10

Expert Comment

by:Ishaan Rawat
ID: 39241801
<td><input name="item4" type="text" class="FreeForm" valign="top" id="item4" value="Type Your Order Here" size="200" style="text-align: left; padding-top: 0px;" />

Open in new window


try this...
0
 

Author Comment

by:DS928
ID: 39241828
Thank you.
I tried both and neither one did it.  Here is the page...
http://www.menuhead.com/makeorder.php
it's the bottom text field.  "Customer Order"
0
Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

 
LVL 58

Expert Comment

by:Gary
ID: 39241838
You want a textarea not an input.
0
 

Author Comment

by:DS928
ID: 39241842
Just got your order! LOL!  So how do I do this?

<td><input name="item4" type="text" class="FreeForm" valign="top" id="item4" value="Type Your Order Here" size="200" />

Open in new window

0
 
LVL 17

Expert Comment

by:jrm213jrm213
ID: 39241849
If your text box has a height set to it so it is larger than the text, the text will always be centered vertically in the box, you can't change it, and messing with padding or margins will cause issues cross browser. If you want your textbox to be taller but have the text vertically aligned to the top, use <textarea></textarea> instead of <input type="text"></input>
0
 
LVL 17

Expert Comment

by:jrm213jrm213
ID: 39241853
hah, didn't see GaryC123's answer, started to answer, went to lunch and submitted.
0
 
LVL 10

Expert Comment

by:Ishaan Rawat
ID: 39241860
<textarea rows="6" columns="14"></textarea>

Open in new window


try something like this...

change the rows and columns as per your needs..
0
 

Author Comment

by:DS928
ID: 39241870
Tried this....quite a mess!

<td><textarea name="item4" id="item4" value="Type Your Order Here" size="200" /textarea>
                                </td>

Open in new window

0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39241878
A text type input field is for single line input.  As it appears you are looking for multi-line input then you should be doing a Gary says and use a text area.

An input is not going to allow multi-line, and the text is not going to wrap.

Please spend a few minutes on a site with basic HTML tutorials to learn the basic use of the form elements.

Cd&
0
 
LVL 58

Expert Comment

by:Gary
ID: 39241879
You missed the starting tag

<td><textarea name="item4" id="item4" value="Type Your Order Here" size="200" </textarea>
                                </td>
0
 
LVL 10

Expert Comment

by:Ishaan Rawat
ID: 39241881
<td><textarea name="item4" id="item4" value="Type Your Order Here" rows="4" columns="15" /textarea>
                                </td>

Open in new window


try something like this...
0
 
LVL 58

Accepted Solution

by:
Gary earned 2000 total points
ID: 39241884
<td>
<textarea name="item4" id="item4" value="Type Your Order Here" size="200"> </textarea>
</td>


Forgot the ending tag myself
0
 

Author Comment

by:DS928
ID: 39241898
This works....

<td><textarea rows="4" cols="50" name="item4" id="item4" value="Type Your Order Here">Type Your Order Here</textarea>
                                </td>

Open in new window

0
 
LVL 10

Expert Comment

by:Ishaan Rawat
ID: 39241902
<td>
<textarea name="item4" id="item4" value="Type Your Order Here" rows="6" cols="20"> </textarea>
</td> 

Open in new window


Text area do not have size as an attribute... use cols and rows instead...
Check here...
http://www.w3schools.com/tags/tag_textarea.asp
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

When it comes to write a Context Sensitive Help (an online help that is obtained from a specific point in state of software to provide help with that state) ,  first we need to make the file that contains all topics, which are given exclusive IDs. …
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

770 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