Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > HTML > can I lock the <TEXTAREA> box

Reply
Thread Tools

can I lock the <TEXTAREA> box

 
 
John Smith
Guest
Posts: n/a
 
      11-17-2003
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


 
Reply With Quote
 
 
 
 
Adrienne
Guest
Posts: n/a
 
      11-17-2003
Gazing into my crystal ball I observed "John Smith"
<(E-Mail Removed)> writing in
news:IDaub.27846$(E-Mail Removed):

> 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/...#edef-TEXTAREA
--
Adrienne Boswell
Please respond to the group so others can share
http://www.arbpen.com
 
Reply With Quote
 
 
 
 
Jukka K. Korpela
Guest
Posts: n/a
 
      11-17-2003
"John Smith" <(E-Mail Removed)> wrote:

> 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.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


 
Reply With Quote
 
Hywel Jenkins
Guest
Posts: n/a
 
      11-17-2003
In article <IDaub.27846$(E-Mail Removed)>,
http://www.velocityreviews.com/forums/(E-Mail Removed) says...
> 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*?

--
Hywel I do not eat quiche
http://hyweljenkins.co.uk/
http://hyweljenkins.co.uk/mfaq.php
 
Reply With Quote
 
Robert Frost-Bridges
Guest
Posts: n/a
 
      11-18-2003
John Smith wrote:

> 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).

--
frostie
http://brightonfixedodds.net
 
Reply With Quote
 
John Smith
Guest
Posts: n/a
 
      11-18-2003
>
> 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


 
Reply With Quote
 
Steve Pugh
Guest
Posts: n/a
 
      11-18-2003
"John Smith" <(E-Mail Removed)> wrote:

>> 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!?


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

--
"My theories appal you, my heresies outrage you,
I never answer letters and you don't like my tie." - The Doctor

Steve Pugh <(E-Mail Removed)> <http://steve.pugh.net/>
 
Reply With Quote
 
Jukka K. Korpela
Guest
Posts: n/a
 
      11-18-2003
"John Smith" <(E-Mail Removed)> wrote:

> 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
style="..." attribute of the <div> element here, but the other options are
more confortable.)

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


Yes, but you also need to set the height of the <div> element, since
otherwise it occupies its natural height, as required by its content.

> 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.)

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html


 
Reply With Quote
 
John Smith
Guest
Posts: n/a
 
      11-18-2003
This is just really beautiful.
I really appreciate everything that everyone has done.
my DIV tag works great

Thank you all.
Guy L Doucet


"Jukka K. Korpela" <(E-Mail Removed)> wrote in message
news:Xns9437AF7487C4Djkorpelacstutfi@193.229.0.31. ..
> "John Smith" <(E-Mail Removed)> wrote:
>
> > 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
> style="..." attribute of the <div> element here, but the other options are
> more confortable.)
>
> > Can you tell me, instead of CSS, can I use the overflow:scroll in the
> > STYLE element in the HEAD, see example:

>
> Yes, but you also need to set the height of the <div> element, since
> otherwise it occupies its natural height, as required by its content.
>
> > 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.)
>
> --
> Yucca, http://www.cs.tut.fi/~jkorpela/
> Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
>
>



 
Reply With Quote
 
Eric Bohlman
Guest
Posts: n/a
 
      11-18-2003
Steve Pugh <(E-Mail Removed)> wrote in
news:(E-Mail Removed):

>>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.


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.)
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
div box questions; float text around a box, fit box to image size Gnarlodious HTML 4 05-05-2010 11:30 AM
Read-Write Lock vs primitive Lock() k3xji Python 7 12-30-2008 10:19 PM
Application.Lock()/UnLock() or lock(Application) nano2k ASP .Net Web Services 2 08-09-2007 09:31 AM
Threading - Why Not Lock Objects Rather than lock the interpreter Fuzzyman Python 3 12-05-2003 10:43 PM
RE: Threading - Why Not Lock Objects Rather than lock theinterpreter Robert Brewer Python 0 12-05-2003 05:33 PM



Advertisments