By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,986 Members | 1,960 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,986 IT Pros & Developers. It's quick & easy.

Javascript and Textarea problem!

P: n/a
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?

Jan 16 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Rene Grothmann wrote:
I try to send a bunch of lines from JavaScript
Which script?
to a Java applet on the same page.
Which applet?
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?


With this vague description, no. Post _some_ code, maybe that will help.

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

P.S.: <URL:http://dcljs.de/>
Jan 16 '06 #2

P: n/a
Rene Grothmann wrote:
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?


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.

--
Rob
Jan 16 '06 #3

P: n/a
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.

Jan 16 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.