Disable a text box & still allow scrolling?

H

harry

some data I have is quite a bit longer than the displayed text box length,
some users can only view this data but set the disabled/readonly attribute
prevents focus on the field so you can't scroll!

is this possible to allow focus & scrolling but without any editing? -

thanks

harry
 
T

The Doormouse

harry said:
is this possible to allow focus & scrolling but without any editing?

You can use CSS to display text in a scrollable box, with no editing.

The Doormouse
 
H

harry

any ideas as to how I would do this?

thanks again - sorry but not the most experienced in CSS!
 
H

harry

all I was trying to do was to have a read only text box that could receive
focus & the user can use the arrow/home/end keys to view all the contents -
why is even the simplest of things always so difficult with web app's?
 
T

Toby Inkster

harry said:
any ideas as to how I would do this?

<div style="height:4em;width:20em;padding:0.5em;margin:0.5em;border:1px
solid black;overflow:auto;">
But I must explain to you how all this mistaken idea of denouncing
pleasure and praising pain was born and I will give you a complete account
of the system, and expound the actual teachings of the great explorer of
the truth, the master-builder of human happiness. No one rejects,
dislikes, or avoids pleasure itself, because it is pleasure, but because
those who do not know how to pursue pleasure rationally encounter
consequences that are extremely painful. Nor again is there anyone who
loves or pursues or desires to obtain pain of itself, because it is pain,
but because occasionally circumstances occur in which toil and pain can
procure him some great pleasure. To take a trivial example, which of us
ever undertakes laborious physical exercise, except to obtain some
advantage from it? But who has any right to find fault with a man who
chooses to enjoy a pleasure that has no annoying consequences, or one who
avoids a pain that produces no resultant pleasure?
</div>
 
A

Adrienne

Gazing into my crystal ball I observed "harry" <[email protected]> writing in

Top posting fixed - please do not top post in the future

Easily remedied. Have a look at http://www.w3schools.com/css/default.asp

Also http://www.blooberry.com/indexdot/css/propindex/position.htm might be
of help.
all I was trying to do was to have a read only text box that could
receive focus & the user can use the arrow/home/end keys to view all
the contents - why is even the simplest of things always so difficult
with web app's?

Is the document in question a form? If not you should not be using a form
element to do this. If it is, however, a form, then you can do
<textarea rows="5" cols="10" readonly name="textarea">This is some readonly
text that will be readonly and the user can scroll, and will also be
submitted with the form.</textarea>

http://www.w3.org/TR/html4/interact/forms.html#edef-TEXTAREA
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top