-2

I have an issue that I can find how to setup vertical scroll-bars but not horizontal scrollbars.

A couple of demos are at:

https://www.w3schools.com/TagS/tag_textarea.asp https://stackoverflow.com/questions/19292559/how-to-scroll-text-area-horizontally

I ran out of references. I am looking to have the box formatted within a table to handle 100% width of the table and the available height.

1
  • I am wanting to use the select box if I can. The rest of the text inputs are with select boxes, and I would want this to have the same look and feel but support multi-line if possible. – Stephen Elliott Sep 25 '17 at 15:20
0

So, with what you explained in the comments, I don't know if I can see what you really need, as to the functions.

If you create a <textarea>, you will have multiline for the user to write.

If you create a <textarea>, and define white-space: pre;, you will have the possibility to have an horizontal bar.

If you create a <textarea>, define white-space: pre;, and tweak a little with JS, you will get a box, with horizontal scrolling and the possibility of defining a maxlength (Like in the example I made: https://codepen.io/anon/pen/MEJqBj

8
  • I want multi-line input boxes so that the user can type in very long text strings that can be read. With the Input, I think it might be limited to viewing one line, and it is not easy for the user to adjust this. With Visual Basic or Visual C++ it is straightforward; it should be the same for HTML. – Stephen Elliott Sep 25 '17 at 16:05
  • Ok, I edited the answer. – Marcelo Henriques Cortez Sep 25 '17 at 16:09
  • I gave you an up vote, but I need a reputation of at least 15 for that up vote to show was the response that I received. Also, I added some additional detail to the answer I provided, and I appreciate your commenting about the answer that I provided also. Thank you for your interest and help! – Stephen Elliott Sep 26 '17 at 8:49
  • I edited my answer. But I'm not sure about the functions you need. If you can, explain the 'flow' of what you need. – Marcelo Henriques Cortez Sep 26 '17 at 9:20
  • And the extra infos you providade, don't put them as an answer. Edit your question and put them there. It's more organized and makes it easier to understand the 'history' – Marcelo Henriques Cortez Sep 26 '17 at 9:22
0

Try https://www.w3schools.com/TAgs/att_textarea_readonly.asp without the readonly field (to allow writing).

Basically try:

    <textarea>
    At w3schools.com you will learn how to make a website. We offer free
    tutorials in all web development technologies.
    </textarea> 

From the related link: https://stackoverflow.com/questions/1125482/how-to-impose-maxlength-on-textarea-in-html-using-javascript/1125521#1125521 one can use the onKeyPress event to update downstream content. For myself, for example, I defined a bunch of text boxes that are updated by other objects in the widget, since it was easier for me to get text boxes to work before the rest could (it was a sure but slow solution).

    <textarea onKeyPress="return ( this.value.length < 1000 );" id = "textareaid" rows="4">
    </textarea>

Within a backend widget for WordPress the "textareaid" needs to be treated delicately (I have another question about that here, but I do not have enough references available to post that link yet in the answer field.)

1

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.