Html Creating a Text Box for a Form

Html Creating a Text Box for a Form

I am creating a form for my website and so far have been able to make the message box larger. But for some reason, text which is inputted into the box stays on one line in the centre of the box.

I want to make the box like the "Your Message" box on this web page:

My code at the moment:

<p>
<label for="from">Your message:</label>
<br />
<input type="text" name="message" id="message" value="type your message..." style="height: 200px; width: 1100px;" onclick="this.value=''"/>
</p>        

3 Answers

You need to use tag as follows.

<p>
   <label for="from">Your message:</label>
<br />
   <textarea name="message" id="message" style="height: 200px; width: 1100px;"     onclick="this.value=''">Enter text here...</textarea>
</p>    

I hope this is what you are looking for.

Regards.

You should use <textarea></textarea> instead of <input/>

Use the <textarea> tag which allows users to type in their own messages.

Try this code:

<textarea rows='8' cols='50'>Your message:</textarea>

<textarea> tags are also resizable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Alexander Ross
Author

Alexander Ross

Alexander Ross has covered the video game industry for a decade, writing deep dives on game design, esports tournaments, VR developments, and gaming culture.