DanSmir
asked on
Format text inside INPUT
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.
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>
I think what you are after is the <textarea></textarea> element, which should be used for multiline text boxes instead.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
you should use ;
<textarea cols = '10' rows = '5' name = 'nomoreproblem'></textarea >
<textarea cols = '10' rows = '5' name = 'nomoreproblem'></textarea
@ali: the cols/rows are deprecated in favor of CSS width/height.
ASKER
10x!!!!
@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"
"The size of a textarea can be specified by the cols and rows attributes, or even better; through CSS' height and width properties"
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
>