Javascript and Textarea problem!

Discussion in 'Javascript' started by Rene Grothmann, Jan 16, 2006.

  1. I try to send a bunch of lines from JavaScript to a Java applet on the
    same page. However, I receive only an empty string, unless the TextArea
    has only one line.

    Can someone put my nose on the right way to send all lines to Java?
     
    Rene Grothmann, Jan 16, 2006
    #1
    1. Advertisements

  2. Which script?
    Which applet?
    With this vague description, no. Post _some_ code, maybe that will help.

    <URL:http://jibbering.com/faq/>


    PointedEars

    P.S.: <URL:http://dcljs.de/>
     
    Thomas 'PointedEars' Lahn, Jan 16, 2006
    #2
    1. Advertisements

  3. Rene Grothmann

    RobG Guest

    As a complete stab in the dark, have you tried replacing all newlines,
    carriage returns, linefeeds, tabs, etc. with a single space? e.g.


    var varToPass = TAref.value.replace(/\s+/g,' ');


    varToPass has the value of the textarea with newlines, carriage returns,
    linefeeds, tabs, etc. replaced by single spaces.

    TAref is a reference to the textarea and varToPass is the variable to send
    to the applet.
     
    RobG, Jan 16, 2006
    #3
  4. The first answer helped me in so far, as it told me that the thing must
    work. So I redid the HTML file from a fresh start, and miracously
    everything works now as expected. I have no idea, what I did
    differently from the last time. Must have been a silly error.

    I have some other problem with the speed of the reaction on the first
    button press. However, I will open a separate thread for this.

    Thanks all.
     
    Rene Grothmann, Jan 16, 2006
    #4
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.