can I lock the <TEXTAREA> box

J

John Smith

I am setting up a site where people will be updating a data file.

People will see their previous entries, they will have an <INPUT> box to
enter a new entry of text to the file, and there will be a SUBMIT and RESET
button at the bottom of the page.

I would like the SUBMIT and RESET buttons to always be at the same spot on
the page.

If however, there are many entries in the file, people will have to scroll
down a lot before clicking on SUBMIT.

I thought of using a TEXTAREA to display the previous entries. This way,
regardless of the number of entries, the TEXTAREA will always be the same
size and they will be able to scroll within the TEXTAREA.

This works great, but I don't want people to think that they can make
changes in the TEXTAREA and assume these changes will be made. In fact, I
wouldn't want previous entries to be updateable anyway.

Is there a way to LOCK the TEXTAREA for viewing only.

Is there a better tool to do this.

All information appreciated
Leo
 
A

Adrienne

I am setting up a site where people will be updating a data file.

People will see their previous entries, they will have an <INPUT> box
to enter a new entry of text to the file, and there will be a SUBMIT
and RESET button at the bottom of the page.

I would like the SUBMIT and RESET buttons to always be at the same spot
on the page.

If however, there are many entries in the file, people will have to
scroll down a lot before clicking on SUBMIT.

I thought of using a TEXTAREA to display the previous entries. This
way, regardless of the number of entries, the TEXTAREA will always be
the same size and they will be able to scroll within the TEXTAREA.

This works great, but I don't want people to think that they can make
changes in the TEXTAREA and assume these changes will be made. In fact,
I wouldn't want previous entries to be updateable anyway.

Is there a way to LOCK the TEXTAREA for viewing only.

Is there a better tool to do this.

All information appreciated
Leo

<textarea readonly>This is some text that is readonly</textarea>
<textarea disabled>This is some text that is disabled and should be
whatever color the UA uses for disabled text</textarea>

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

Jukka K. Korpela

John Smith said:
I am setting up a site where people will be updating a data file.
People will see their previous entries, they will have an <INPUT> box to
enter a new entry of text to the file, and there will be a SUBMIT and
RESET button at the bottom of the page.

RESET sounds ominous. The RESET button almost never helps the user, but
often hurts him.
I would like the SUBMIT and RESET buttons to always be at the same spot
on the page.

Why? The SUBMIT button should be at the end of a form, of course. And the
RESET button should be nowhere, or, in rare cases, at the _start_. The
actual physical placement will vary, of course.
If however, there are many entries in the file, people will have to
scroll down a lot before clicking on SUBMIT.

If they are supposed to read the text, that's acceptable. If not, why
included the text?
I thought of using a TEXTAREA to display the previous entries.

That would be _very_ confusing. It _is_ for input, after all.

Even if you could make it readonly or disabled - and you cannot, in any 100%
cross-browser compatible way - it would still confuse.
This works great, but I don't want people to think that they can make
changes in the TEXTAREA and assume these changes will be made.

So don't use TEXTAREA.
Is there a better tool to do this.

Well, you could put the text inside a DIV element with a specified height
(say 8em) and overflow:scroll in CSS. This would work in most modern
browsers, and should not hurt when it does not work - the DIV simply
degrades to a normal non-scrollable block of text.
 
H

Hywel Jenkins

I thought of using a TEXTAREA to display the previous entries. This way,
regardless of the number of entries, the TEXTAREA will always be the same
size and they will be able to scroll within the TEXTAREA.

This works great, but I don't want people to think that they can make
changes in the TEXTAREA and assume these changes will be made. In fact, I
wouldn't want previous entries to be updateable anyway.

Is there a way to LOCK the TEXTAREA for viewing only.

What's the point of using an *input* element if you're not going to use
it for *input*?
 
R

Robert Frost-Bridges

John said:
I am setting up a site where people will be updating a data file. [snip]

I thought of using a TEXTAREA to display the previous entries. This
way, regardless of the number of entries, the TEXTAREA will always be
the same size and they will be able to scroll within the TEXTAREA.

This works great, but I don't want people to think that they can make
changes in the TEXTAREA and assume these changes will be made. In
fact, I wouldn't want previous entries to be updateable anyway.

Is there a way to LOCK the TEXTAREA for viewing only.

I don't know what you've got available to your host but you would
probably be best keeping all the previous entries in a database and
writing them out to the page from there to divs (for instance).
You could then use the textarea for input to the database. (minus the
reset button, I'd hate to spend ten minutes typing in my new input then
click the wrong button by mistake).
 
J

John Smith

RESET sounds ominous. The RESET button almost never helps the user, but
often hurts him.

I took reset out
Well, you could put the text inside a DIV element with a specified height
(say 8em) and overflow:scroll in CSS. This would work in most modern
browsers, and should not hurt when it does not work - the DIV simply
degrades to a normal non-scrollable block of text.

I'm very rusty with CSS.
I even thought CSS code was within the HTML page but the Google searches
tell me it's in a separate file!?

Can you tell me, instead of CSS, can I use the overflow:scroll in the STYLE
element in the HEAD, see example:
I apologize again. I don't know how tags will appear in newsgroup readers so
I used parenthesis instead of lesser and greater than signs.
Is there a standard in this group for that?

(HEAD)
(STYLE)
DIV{overflow:scroll;}
(/STYLE)
(/HEAD)

Anyway, this doesn't appear to work.
Any help would be great.

If not, I may have to use the TEXTAREA element with the READONLY attibute.

Thanks for all,
Guy Doucet
 
S

Steve Pugh

John Smith said:
I'm very rusty with CSS.
I even thought CSS code was within the HTML page but the Google searches
tell me it's in a separate file!?

It can be either.
Can you tell me, instead of CSS, can I use the overflow:scroll in the STYLE
element in the HEAD, see example:

overflow: scroll; is still CSS regardless of whether it goes in a
separate file or in the style element or in a style attribute.
I apologize again. I don't know how tags will appear in newsgroup readers so
I used parenthesis instead of lesser and greater than signs.

They'll appear eaxctly as you type them unless the newsreader is
broken or unless you send the post as HTML.
Is there a standard in this group for that?

For long examples post a URL instead. For short examples type the code
exactly as you would in your web page.
(STYLE)
DIV{overflow:scroll;}
(/STYLE)

There should be a type="text/css" attribute.
Anyway, this doesn't appear to work.

You've told it to scroll if the content overflows. But as you haven't
specified a height the content will never overflow as the div will
always have the same height as the content.

div { height: 6em; overflow: scroll;}

Steve
 
J

Jukka K. Korpela

John Smith said:
I'm very rusty with CSS.

Luckily this is a case where CSS is easy.
I even thought CSS code was within the HTML page but the Google searches
tell me it's in a separate file!?

It's recommendable to put CSS code into a separate .css file and refer to it
with a <link> element, but you can alternatively put the CSS code inside a
<style> element. (In fact, you could even put the CSS code into a
Can you tell me, instead of CSS, can I use the overflow:scroll in the
STYLE element in the HEAD, see example:

I don't know how tags will appear in newsgroup
readers so I used parenthesis instead of lesser and greater than signs.
Is there a standard in this group for that?

The standard is to write tags as such. Usenet articles are by definition
plain text, and any program that interprets them as HTML is broken (at least
if the article is not declared as text/html in message headers - but such
format is _not_ welcome). In fact if I write <font size="7" color="red">
<blink>Fix your newsreader</blink></font>, then it's very friendly towards
people who use such broken programs - they get warned now, instead of
waiting for the effects some really hostile markup.

So basically you just need to set overflow and scroll, but the appearance
might be better if you also set a border around the <div>, and this in turn
makes some padding desirable (in order to prevent text from touching the
border):

<head>
<title>Demo</title>
<style type="text/css">
div.scrollable { height: 8em;
overflow: scroll;
border: solid gray 1px;
padding: 0.2em 0.6em; }
</style>
<body>
<div class="scrollable">
content goes here, normal HTML markup allowed
</div>

For a quick reference to basic CSS properties (CSS level 1), consult
http://www.htmlhelp.com/reference/css/properties.html

(You might wish to set the width property, too, and maybe background and
color properties as well.)
 
J

John Smith

This is just really beautiful.
I really appreciate everything that everyone has done.
my DIV tag works great
:) :) :) :) :) :) :) :) :) :) :) :)
Thank you all.
Guy L Doucet
 
E

Eric Bohlman

For long examples post a URL instead. For short examples type the code
exactly as you would in your web page.

May I suggest "copy and paste" rather than "type" here? Code and markup
have this remarkable tendency to mutate when retyped into newsgroup posts.
This leads to all sorts of wasted time as people try to track down problems
that didn't make it into the post (if you're retyping, it's often the case
that you'll include what you meant to write in the original, rather than
what you actually did write in the original), problems that were introduced
in the retyping, and so on. It's just in the nature of computing that if
one piece of code or markup is "something like" another piece, its behavior
in the Real World is quite likely to "something completely different." (No,
I wasn't consciously trying to start that sentence with one Pythonism and
end it with another, but I like the effect.)
 

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

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top