Solved

Format text inside INPUT

Posted on 2009-05-06
7
400 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
  • 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 500 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
Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

 
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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Menu Selected on Chrome for Windows 13 18
Width of Page is Affecting Side Menu 6 25
Place text over image using CSS 6 44
How to show span when clicked on? 10 21
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.

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