[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Format text inside INPUT

Posted on 2009-05-06
7
Medium Priority
?
406 Views
Last Modified: 2012-05-06
Hello experts,

I have a problem with text formatting inside input tag.
I'm trying to take line down inside input field and it's not working, please help.

When i'm typing text that width bigger that 400px it not going one line down.
Each time that i'm pressing enter inside input my form submitted.

Please assist.
<tr>
            <td>
                <input style="width: 400px; height: 100px;" type="text" name="Problem" />
           
            </td>

Open in new window

0
Comment
Question by:DanSmir
[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
  • 2
7 Comments
 
LVL 39

Expert Comment

by:abel
ID: 24319721
I think what you are after is the <textarea></textarea> element, which should be used for multiline text boxes instead.
0
 
LVL 39

Accepted Solution

by:
abel earned 2000 total points
ID: 24319752
So, altogether that becomes:

<textarea style="width: 400px; height: 100px;" name="Problem" id ="Problem"></textarea>
0
 
LVL 14

Expert Comment

by:Ali Kayahan
ID: 24319794
you should use ;
<textarea cols = '10' rows = '5' name = 'nomoreproblem'></textarea>
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 39

Expert Comment

by:abel
ID: 24319844
@ali: the cols/rows are deprecated in favor of CSS width/height.
0
 

Author Closing Comment

by:DanSmir
ID: 31578736
10x!!!!
0
 
LVL 14

Expert Comment

by:Ali Kayahan
ID: 24319931
@abel : thanks for your notice but not deprecated , w3's definition for it ;
"The size of a textarea can be specified by the cols and rows attributes, or even better; through CSS' height and width properties"
0
 
LVL 39

Expert Comment

by:abel
ID: 24320122
Indeed, you are right, apologies. And if you check the xhmtl1-strict DTD, it even says it is required, which means you actually have to use them. For finer control, however, I would always recommend using width/height as well.



<!ATTLIST textarea
  %attrs;
  %focus;
  name        CDATA          #IMPLIED
  rows        %Number;       #REQUIRED
  cols        %Number;       #REQUIRED
  disabled    (disabled)     #IMPLIED
  readonly    (readonly)     #IMPLIED
  onselect    %Script;       #IMPLIED
  onchange    %Script;       #IMPLIED
  >

Open in new window

0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
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).

650 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