Solved

Format text inside INPUT

Posted on 2009-05-06
7
402 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 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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

CSS is a visual language used to classify objects and define rules about how they should be displayed. CSS skills aren’t restricted to developers anymore, there is a big benefit to having a basic understanding of the language, regardless of your occ…
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to embed videos in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <video> tag to insert a video. Define the src as the URL of your video; this is similar to …
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

733 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