Solved

Format text inside INPUT

Posted on 2009-05-06
7
401 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
Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying 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

Suggested Solutions

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
Finding original email is quite difficult due to their duplicates. From this article, you will come to know why multiple duplicates of same emails appear and how to delete duplicate emails from Outlook securely and instantly while vital emails remai…
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

828 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