MultiLine form in HTML?

I am trying to get some input from a user and use this input in a php script. Right now I have a form tag, of the few that I understand, this can't have multi-line input. The solution seems to be TextArea, however I'm not sure how to get input from TextArea.

Here is my code with the form:

<form action="traitement_cmd.php" method="post" >
    Enter Cmd: <input type="text" size="100" maxlength="100" name="cmd"/>
</form>

The textarea tag does not seem to have the same attributes as the form tag, so I'm not sure how to change my code. I also need a button so the user can click to send their input to a php script.

How can I change my code to do this?

Thanks.

+3
source share
3 answers

:

<form action="traitement_cmd.php" method="post" >
	    Enter Cmd: <textarea rows="5" cols="80" name="cmd"></textarea>
		<input type="submit" value="Submit"/>
</form>
+2

, HTML 4.01:

TEXTAREA, 20 80 . TEXTAREA submit reset.

<FORM action="http://somesite.com/prog/text-read" method="post">
   <P>
   <TEXTAREA name="thetext" rows="20" cols="80">
   First line of initial text.
   Second line of initial text.
   </TEXTAREA>
   <INPUT type="submit" value="Send"><INPUT type="reset">
   </P>
</FORM>
+3

textarea attributes are "rows" and "cols".

0
source

Source: https://habr.com/ru/post/1726105/


All Articles