insert text dynamically into textarea

Discussion in 'Javascript' started by cyprian, Jul 18, 2007.

  1. cyprian

    cyprian Guest

    how do i use javascript function to dynamically insert text into
    textarea from the result of an array comparison expression. read the
    dom but found no way out.
    thanks
     
    cyprian, Jul 18, 2007
    #1
    1. Advertising

  2. On Jul 18, 2:05 pm, "David Mark" <> wrote:
    > "cyprian" <> wrote in message
    >
    > news:...
    >
    > > how do i use javascript function to dynamically insert text into
    > > textarea from the result of an array comparison expression. read the

    >
    > Regardless of what it is a result of, you can set the value property of the
    > textarea element.
    >
    > > dom but found no way out.

    >
    > Try looking up "createTextNode" and "appendChild."


    Why would you suggest looking up createTextNode and appendChild in
    order to set the .value property of a Form Element?

    document.formID.textAreaName.value = "something new";

    Trivial stuff, don't make it harder than it has to be.

    --
    Randy
    Anybody that serves XHTML on the web
    has an IQ just above the shoe size of
    a 2 year old infant.
     
    One Dumm Hikk, Jul 20, 2007
    #2
    1. Advertising

  3. cyprian

    David Mark Guest

    One Dumm Hikk wrote:
    > On Jul 18, 2:05 pm, "David Mark" <> wrote:
    > > "cyprian" <> wrote in message
    > >
    > > news:...
    > >
    > > > how do i use javascript function to dynamically insert text into
    > > > textarea from the result of an array comparison expression. read the

    > >
    > > Regardless of what it is a result of, you can set the value property of the
    > > textarea element.
    > >
    > > > dom but found no way out.

    > >
    > > Try looking up "createTextNode" and "appendChild."

    >
    > Why would you suggest looking up createTextNode and appendChild in
    > order to set the .value property of a Form Element?


    I suggested the value property first. He said he could find no DOM
    equivalent, so I enlightened him on those methods too.

    >
    > document.formID.textAreaName.value = "something new";
    >
    > Trivial stuff, don't make it harder than it has to be.
    >
    > --
    > Randy
    > Anybody that serves XHTML on the web
    > has an IQ just above the shoe size of
    > a 2 year old infant.


    That's silly. Does that include the W3C? There is no way I would
    store content on a Web server locked up in HTML. Nor would I make the
    server work to transform every page into HTML on-the-fly. So there is
    only one solution that I see: serve XHTML as XML to those browsers
    that can understand it and send it as text/html to IE. Works fine for
    me.
     
    David Mark, Jul 20, 2007
    #3
  4. cyprian

    David Mark Guest

    On Jul 21, 2:22 am, Randy Webb <> wrote:
    > David Mark said the following on 7/20/2007 2:54 PM:
    >
    > > One Dumm Hikk wrote:
    > >> On Jul 18, 2:05 pm, "David Mark" <> wrote:
    > >>> "cyprian" <> wrote in message

    >
    > >>>news:...

    >
    > <snip>
    >
    > >> --
    > >> Randy
    > >> Anybody that serves XHTML on the web
    > >> has an IQ just above the shoe size of
    > >> a 2 year old infant.

    >
    > > That's silly.

    >
    > While you may consider it "silly", it is true.
    >
    > > Does that include the W3C?

    >
    > If the W3C tries to pass of XHTML to IE, then yes they are lacking in
    > the IQ area as well.
    >
    > > There is no way I would store content on a Web server locked up in HTML.

    >
    > There is no way *I* would store XHTML on a web server since 90% or so of
    > the web doesn't know what it is.


    IE does fine with it, despite not knowing what it is. And I have read
    that IE8 will have an XML parser. I am sure you understand the value
    of having content in XML as most of the Web understands RSS (for
    example.)

    >
    > > Nor would I make the server work to transform every page into HTML on-the-fly.

    >
    > Who said anything about transforming pages? It is simple:


    That is a standard argument of XHTML detractors. They can't deny that
    XML has benefits, so they suggest transforming it to HTML to send to
    browsers.

    >
    > Write HTML4.01
    > Serve it as text/html
    > Script it with an HTML DOM
    >
    > What's the problem? XHTML is a dead language. Even the W3C gave up on it
    > and moved on to HTML5.


    I don't agree with you there. They haven't announced any such thing
    and their own site is XHTML.

    >
    > > So there is only one solution that I see: serve XHTML as XML to those browsers
    > > that can understand it and send it as text/html to IE. Works fine for
    > > me.

    >
    > Then you are not scripting a true XHTML document in non-IE browsers and
    > having that same script execute in IE unless it is a trivially simple
    > script.


    Sure I am. I have an entire application framework that works
    efficiently in both modes. I went over that with another XHTML
    detractor in a recent thread.
     
    David Mark, Jul 21, 2007
    #4
  5. cyprian

    David Mark Guest

    On Jul 21, 9:48 pm, Randy Webb <> wrote:
    > David Mark said the following on 7/21/2007 3:41 PM:
    >
    > > On Jul 21, 2:22 am, Randy Webb <> wrote:
    > >> David Mark said the following on 7/20/2007 2:54 PM:

    >
    > >>> One Dumm Hikk wrote:
    > >>>> On Jul 18, 2:05 pm, "David Mark" <> wrote:
    > >>>>> "cyprian" <> wrote in message
    > >>>>>news:...

    >
    > <snip>
    >
    > >>> There is no way I would store content on a Web server locked up in HTML.
    > >> There is no way *I* would store XHTML on a web server since 90% or so of
    > >> the web doesn't know what it is.

    >
    > > IE does fine with it, despite not knowing what it is.

    >
    > If you consider IE having to parse it as tag soup and then trying to
    > make sense of the resulting DOM "fine with it".....
    >
    > > And I have read that IE8 will have an XML parser.

    >
    > They said that about IE7...
    > They said that about IE6...


    As I understand it, it just missed the cut in IE7.

    >
    > The last I read from MS about XHTML was that it simply wasn't worth the
    > effort to support it for the small benefit it offers over HTML4.01 Strict.


    That sounds like a turn of the century quote to me.

    >
    > > I am sure you understand the value of having content in XML as most
    > > of the Web understands RSS (for example.)

    >
    > And you have not seen me say differently. We are not discussing XML, we
    > are discussing XHTML and - directly - it's use as a language on the Web.


    As I am sure you know, XHTML is XML. That's the whole point. Just
    like RSS and XHTML Basic are XML. You can easily transform one flavor
    into another, but you can't efficiently transform HTML into anything
    useful.

    >
    > >>> Nor would I make the server work to transform every page into HTML on-the-fly.
    > >> Who said anything about transforming pages? It is simple:

    >
    > > That is a standard argument of XHTML detractors. They can't deny that
    > > XML has benefits, so they suggest transforming it to HTML to send to
    > > browsers.

    >
    > You have, sadly, mistaken me for an XHTML detractor. It has it's
    > benefits, just not for the WWW in general.


    Okay. An "XHTML on the Web" detractor.

    >
    > >> Write HTML4.01
    > >> Serve it as text/html
    > >> Script it with an HTML DOM

    >
    > >> What's the problem? XHTML is a dead language. Even the W3C gave up on it
    > >> and moved on to HTML5.

    >
    > > I don't agree with you there. They haven't announced any such thing
    > > and their own site is XHTML.

    >
    > It only takes common sense to figure it out.


    Figure what out? The w3c has never said that HTML 5 is a replacement
    for XHTML 2. They are two different initiatives with completely
    different goals.

    >
    > >>> So there is only one solution that I see: serve XHTML as XML to those browsers
    > >>> that can understand it and send it as text/html to IE. Works fine for
    > >>> me.
    > >> Then you are not scripting a true XHTML document in non-IE browsers and
    > >> having that same script execute in IE unless it is a trivially simple
    > >> script.

    >
    > > Sure I am. I have an entire application framework that works
    > > efficiently in both modes. I went over that with another XHTML
    > > detractor in a recent thread.

    >
    > Once again, you have - mistakenly - assumed I am an "XHTML detractor"
    > when that is not true. I just know it is a mistake to put it on the Web
    > for an audience where 80+% of the clients don't know what it is.
    >


    IE doesn't know what it is technically, but it renders it just fine.
    It seems to me that the real concern of the "XHTML is harmful on the
    Web" crowd is that 90% of the authors don't know what it is. But that
    is not my concern.
     
    David Mark, Jul 22, 2007
    #5
  6. cyprian

    David Mark Guest

    On Jul 22, 6:45 pm, Randy Webb <> wrote:
    > David Mark said the following on 7/22/2007 2:00 PM:
    >
    >
    >
    >
    >
    > > On Jul 21, 9:48 pm, Randy Webb <> wrote:
    > >> David Mark said the following on 7/21/2007 3:41 PM:

    >
    > >>> On Jul 21, 2:22 am, Randy Webb <> wrote:
    > >>>> David Mark said the following on 7/20/2007 2:54 PM:
    > >>>>> One Dumm Hikk wrote:
    > >>>>>> On Jul 18, 2:05 pm, "David Mark" <> wrote:
    > >>>>>>> "cyprian" <> wrote in message
    > >>>>>>>news:...
    > >> <snip>

    >
    > >>>>> There is no way I would store content on a Web server locked up in HTML.
    > >>>> There is no way *I* would store XHTML on a web server since 90% or so of
    > >>>> the web doesn't know what it is.
    > >>> IE does fine with it, despite not knowing what it is.
    > >> If you consider IE having to parse it as tag soup and then trying to
    > >> make sense of the resulting DOM "fine with it".....

    >
    > >>> And I have read that IE8 will have an XML parser.
    > >> They said that about IE7...
    > >> They said that about IE6...

    >
    > > As I understand it, it just missed the cut in IE7.

    >
    > They said that about IE6.... But no, it didn't "just miss the cut".
    >
    > >> The last I read from MS about XHTML was that it simply wasn't worth the
    > >> effort to support it for the small benefit it offers over HTML4.01 Strict.

    >
    > > That sounds like a turn of the century quote to me.

    >
    > Actually, it is somewhere in the MSDN Blogs that were being written at
    > the time that IE7 was Beta or about to become public. I will keep
    > looking for the link again. It was written, I believe, by Peter Torr
    > (don't quote me on the name) but it was an MS rep. I trust him more than
    > a Usenet Poster.
    >
    > >>> I am sure you understand the value of having content in XML as most
    > >>> of the Web understands RSS (for example.)
    > >> And you have not seen me say differently. We are not discussing XML, we
    > >> are discussing XHTML and - directly - it's use as a language on the Web.

    >
    > > As I am sure you know, XHTML is XML. That's the whole point. Just
    > > like RSS and XHTML Basic are XML. You can easily transform one flavor
    > > into another, but you can't efficiently transform HTML into anything
    > > useful.

    >
    > That is why I don't store static HTML. To do that is idiotic if you want
    > to transform it.


    So what do you store then? I assume XML, which would mean your server
    has to transform it to HTML with each request.

    >
    > >>>>> Nor would I make the server work to transform every page into HTML on-the-fly.
    > >>>> Who said anything about transforming pages? It is simple:
    > >>> That is a standard argument of XHTML detractors. They can't deny that
    > >>> XML has benefits, so they suggest transforming it to HTML to send to
    > >>> browsers.
    > >> You have, sadly, mistaken me for an XHTML detractor. It has it's
    > >> benefits, just not for the WWW in general.

    >
    > > Okay. An "XHTML on the Web" detractor.

    >
    > Yippeeeeee, I have another phrase attached to me. Granted, it is nicer
    > than a lot of the ones attached to me.
    >
    > >>>> Write HTML4.01
    > >>>> Serve it as text/html
    > >>>> Script it with an HTML DOM
    > >>>> What's the problem? XHTML is a dead language. Even the W3C gave up on it
    > >>>> and moved on to HTML5.
    > >>> I don't agree with you there. They haven't announced any such thing
    > >>> and their own site is XHTML.
    > >> It only takes common sense to figure it out.

    >
    > > Figure what out?

    >
    > If you have to ask that......


    You seem to have trailed off.

    >
    > > The w3c has never said that HTML 5 is a replacement
    > > for XHTML 2. They are two different initiatives with completely
    > > different goals.

    >
    > Who said any differently?


    You said XHTML was dead and the w3c has "moved on" to HTML 5 and asked
    the reader to "figure it out." So what were you implying>

    >
    > >>>>> So there is only one solution that I see: serve XHTML as XML to those browsers
    > >>>>> that can understand it and send it as text/html to IE. Works fine for
    > >>>>> me.
    > >>>> Then you are not scripting a true XHTML document in non-IE browsers and
    > >>>> having that same script execute in IE unless it is a trivially simple
    > >>>> script.
    > >>> Sure I am. I have an entire application framework that works
    > >>> efficiently in both modes. I went over that with another XHTML
    > >>> detractor in a recent thread.
    > >> Once again, you have - mistakenly - assumed I am an "XHTML detractor"
    > >> when that is not true. I just know it is a mistake to put it on the Web
    > >> for an audience where 80+% of the clients don't know what it is.

    >
    > > IE doesn't know what it is technically, but it renders it just fine.

    >
    > Depends on your definition of "just fine" and how complex the page is.


    FWIW, I primarily write Web applications and they get a lot more
    complex than the average Web page (ie if I can make it work, then it
    is more than suitable for the Web in general.)

    >
    > > It seems to me that the real concern of the "XHTML is harmful on the
    > > Web" crowd is that 90% of the authors don't know what it is. But that
    > > is not my concern.

    >
    > <URL:http://www.spartanicus.utvinternet.ie/no-xhtml.htm>
    > Try it and the links in it......


    I've seen many sites just like it. That particular one seems outdated
    as it warns about Opera 7, which prefers HTML (not a problem if you
    negotiate properly.) The latest Opera browsers prefer XHTML.
     
    David Mark, Jul 23, 2007
    #6
  7. cyprian

    David Mark Guest

    On Jul 23, 1:23 am, Randy Webb <> wrote:
    > David Mark said the following on 7/22/2007 7:09 PM:
    >
    >
    >
    >
    >
    > > On Jul 22, 6:45 pm, Randy Webb <> wrote:
    > >> David Mark said the following on 7/22/2007 2:00 PM:

    >
    > >>> On Jul 21, 9:48 pm, Randy Webb <> wrote:
    > >>>> David Mark said the following on 7/21/2007 3:41 PM:
    > >>>>> On Jul 21, 2:22 am, Randy Webb <> wrote:
    > >>>>>> David Mark said the following on 7/20/2007 2:54 PM:
    > >>>>>>> One Dumm Hikk wrote:
    > >>>>>>>> On Jul 18, 2:05 pm, "David Mark" <> wrote:
    > >>>>>>>>> "cyprian" <> wrote in message
    > >>>>>>>>>news:...
    > >>>> <snip>

    >
    > <snip that probably isn't proper>
    >
    > >>>>> I am sure you understand the value of having content in XML as most
    > >>>>> of the Web understands RSS (for example.)
    > >>>> And you have not seen me say differently. We are not discussing XML, we
    > >>>> are discussing XHTML and - directly - it's use as a language on the Web.
    > >>> As I am sure you know, XHTML is XML. That's the whole point. Just
    > >>> like RSS and XHTML Basic are XML. You can easily transform one flavor
    > >>> into another, but you can't efficiently transform HTML into anything
    > >>> useful.
    > >> That is why I don't store static HTML. To do that is idiotic if you want
    > >> to transform it.

    >
    > > So what do you store then? I assume XML, which would mean your server
    > > has to transform it to HTML with each request.

    >
    > Actually, there are very very few HTML files on the Intranet server that
    > I use. Most of the data is stored in a database and creates .js files on
    > the fly. Everything in the system was designed with two things in mind -
    > speed and server load. The more I can make the client machine do then
    > the less my server has to do. Switching to the current back end system
    > (the front end looks almost identical to the old version) took almost 3
    > years and more hours of work than I care to remember. It has sped up my
    > Intranet almost 10-fold by moving the processing load from the server to
    > the client machine.


    What do JS files have to do with the XHTML vs. HTML discussion?

    >
    > The public website is slowly being migrated to the same system of using
    > .js files loaded on the fly. I have found it to be simpler, more
    > reliable, and quicker than trying to make XHR requests and deal with the
    > response. The major issue with the website being migrated is the lack of
    > support and problems with loading .js files on mac platforms and some of
    > the older legacy PC browsers. If, and when, the support becomes more
    > available on mac browsers and the legacy PC browsers are finally dead
    > and gone, the website will be switched to the same system as well.
    >
    > As for transforming XML to HTML, you might try looking at the
    > process.wsf file and the index.xml file that is used to create this very
    > groups FAQ. Edit the xml file, run the process.wsf file, and it creates
    > the HTML file on the fly for you. So no, I don't buy into the "Its
    > easier to transform XML to XHTML than HTML" argument.


    That wasn't my argument. Of course you transform XML into HTML. What
    is silly is transforming XHTML into HTML, when you could just send the
    XHTML.

    >
    > <snip>
    >
    > >>> It seems to me that the real concern of the "XHTML is harmful on the
    > >>> Web" crowd is that 90% of the authors don't know what it is. But that
    > >>> is not my concern.
    > >> <URL:http://www.spartanicus.utvinternet.ie/no-xhtml.htm>
    > >> Try it and the links in it......

    >
    > > I've seen many sites just like it. That particular one seems outdated
    > > as it warns about Opera 7, which prefers HTML (not a problem if you
    > > negotiate properly.) The latest Opera browsers prefer XHTML.

    >
    > While it is slightly outdated, the only information on that page that is
    > still outdated is indeed the warning about Opera 7. The other issues
    > that it brings up are still valid issues for not serving XHTML on the
    > web though. If you want to serve XHTML on the web, by all means do so.
    > Just don't expect to push it here in comp.lang.javascript without being


    I don't push anything in here. I think the original discussion arose
    from some silly tag line of yours that insulted anyone and everyone
    who used XHTML on the Web. So don't expect to do that without being
    challenged. Or perhaps you can as I am growing weary of this whole
    argument.
     
    David Mark, Jul 23, 2007
    #7
    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. Rick Csucsai

    how to insert text into middle of textarea

    Rick Csucsai, Jun 21, 2005, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    286
    Harolds
    Jun 24, 2005
  2. Gordan

    insert text in textarea

    Gordan, Sep 2, 2003, in forum: Javascript
    Replies:
    0
    Views:
    102
    Gordan
    Sep 2, 2003
  3. Paul Gorodyansky
    Replies:
    7
    Views:
    235
    Martin Honnen
    Feb 6, 2005
  4. cyprian
    Replies:
    0
    Views:
    119
    cyprian
    Jul 18, 2007
  5. globalrev

    insert javascrpt into textarea?

    globalrev, May 11, 2008, in forum: Javascript
    Replies:
    15
    Views:
    238
    Dr J R Stockton
    May 12, 2008
Loading...

Share This Page