Solved

Format text inside INPUT

Posted on 2009-05-06
7
398 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
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
Why do we like using grid based layouts in website design? Let's look at the live examples of websites and compare them to grid based WordPress themes.
In this tutorial viewers will learn how to style different bullet points for unordered lists in CSS. Begin with a normal unordered list; the default bullet point is a solid circle: In the CSS, create a defined class of unordered list by typing "ul.S…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

762 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now