can I lock the <TEXTAREA> box

Discussion in 'HTML' started by John Smith, Nov 17, 2003.

  1. John Smith

    John Smith Guest

    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
     
    John Smith, Nov 17, 2003
    #1
    1. Advertising

  2. John Smith

    Adrienne Guest

    Gazing into my crystal ball I observed "John Smith"
    <> writing in
    news:IDaub.27846$:

    > 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
    --
    Adrienne Boswell
    Please respond to the group so others can share
    http://www.arbpen.com
     
    Adrienne, Nov 17, 2003
    #2
    1. Advertising

  3. "John Smith" <> 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
     
    Jukka K. Korpela, Nov 17, 2003
    #3
  4. In article <IDaub.27846$>,
    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
     
    Hywel Jenkins, Nov 17, 2003
    #4
  5. 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
     
    Robert Frost-Bridges, Nov 18, 2003
    #5
  6. John Smith

    John Smith Guest

    >
    > 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
     
    John Smith, Nov 18, 2003
    #6
  7. John Smith

    Steve Pugh Guest

    "John Smith" <> 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 <> <http://steve.pugh.net/>
     
    Steve Pugh, Nov 18, 2003
    #7
  8. "John Smith" <> 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
     
    Jukka K. Korpela, Nov 18, 2003
    #8
  9. John Smith

    John Smith Guest

    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" <> wrote in message
    news:Xns9437AF7487C4Djkorpelacstutfi@193.229.0.31...
    > "John Smith" <> 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
    >
    >
     
    John Smith, Nov 18, 2003
    #9
  10. John Smith

    Eric Bohlman Guest

    Steve Pugh <> wrote in
    news::

    >>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.)
     
    Eric Bohlman, Nov 18, 2003
    #10
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Fuzzyman
    Replies:
    3
    Views:
    530
    Andrew MacIntyre
    Dec 5, 2003
  2. Robert Brewer
    Replies:
    0
    Views:
    516
    Robert Brewer
    Dec 5, 2003
  3. k3xji
    Replies:
    7
    Views:
    875
    Gabriel Genellina
    Dec 30, 2008
  4. nano2k

    Application.Lock()/UnLock() or lock(Application)

    nano2k, Jul 23, 2007, in forum: ASP .Net Web Services
    Replies:
    2
    Views:
    311
    nano2k
    Aug 9, 2007
  5. Augustus
    Replies:
    1
    Views:
    393
    Ken Schaefer
    Sep 10, 2003
Loading...

Share This Page