[Logo] JavaRanch » JavaRanch Saloon
  Search | FAQ | Recent Topics | Hot Topics
Register / Login


Reply Bookmark it! Watch this topic JavaRanch » Forums » Engineering » HTML and JavaScript
 
RSS feed
 
New topic
Author

Get the input box value from applet & transfer it to javaScript

Darren Alexandria
Ranch Hand

Joined: Aug 17, 2007
Messages: 185

Good day!

I have an applet which is currently embedded in a JSP page.
What I am trying to do is to access or get the value in the
input box using javaScript.

Here is my applet tag


Here's what I used in javaScript:


But all I get is an undefined value.

[ UD: added linebreaks to preserve formatting ]
[ March 13, 2008: Message edited by: Ulf Dittmer ]
Ulf Dittmer
Sheriff

Joined: Mar 22, 2005
Messages: 26723

The applet tag -which is what getElementById returns- does not have a "value" attribute. If you want to access data in the applet, write a public method that returns it, and call it like document.getElementById('appletbarcode').getValue().

Java web chartsImageJ PluginsSpecification URLsJava FAQs
Darren Alexandria
Ranch Hand

Joined: Aug 17, 2007
Messages: 185

I'm sorry if I cross-posted.. I think I have done it twice today..

This is the code that I have written which simply shows an input box:


When I input a value in this applet, I wish to get it in javaScript.
Ulf Dittmer
Sheriff

Joined: Mar 22, 2005
Messages: 26723

As I said elsewhere, that's what LiveConnect does.

Java web chartsImageJ PluginsSpecification URLsJava FAQs
Darren Alexandria
Ranch Hand

Joined: Aug 17, 2007
Messages: 185

Thanks for your reply.
I am starting to read in now, and hope that I'll be
able to understand and implement it.



BTW,
Can Live Connect be used in IE?
[ March 13, 2008: Message edited by: Darren Alexandria ]
 
jQuery in Action
 
 
Reply Bookmark it! Watch this topic JavaRanch » Forums » Engineering » HTML and JavaScript
 
RSS feed
 
New topic
JProfiler
Get rid of your performance problems and memory leaks!