Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I create a scrollable textbox?

Tags:

html

css

Currently, the site has the following css class that is intended to be used for note (longer texts) entries in a form.

.scrollabletextbox {
    height:100px;
    width:200px;
    font-family: Verdana, Tahoma, Arial, Helvetica, sans-serif;
    font-size: 82%;
    overflow:scroll;
}

The size of the box and other styling register correctly, but the text start vertically centered and never line breaks. The only way to view the text completely is to move the cursor left/right.

The form uses the following html (with a little php) to implement the large text box

<input type="text" class="scrollabletextbox" name="note" value="<?php echo $note; ?>">

Thank you in advance for any help.

like image 803
aray12 Avatar asked Aug 13 '13 23:08

aray12


1 Answers

Try replacing input type="text" with textarea tag.

Change your code to:

<textarea class="scrollabletextbox" name="note">
  <?php echo $note; ?>
</textarea>

It sends data just as a normal input tag, so you can get data from it with the same methods.

Read more info about textarea tag

like image 187
Wilq Avatar answered Oct 17 '22 09:10

Wilq