Author
Get the input box value from applet & transfer it to javaScript
Darren Alexandria
Ranch Hand
Joined: Aug 17, 2007
Messages: 185
posted Mar 12, 2008 19:58:00
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: 26795
posted Mar 13, 2008 00:05:00
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 charts — ImageJ Plugins — Specification URLs — Java FAQs
Darren Alexandria
Ranch Hand
Joined: Aug 17, 2007
Messages: 185
posted Mar 13, 2008 02:58:00
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: 26795
posted Mar 13, 2008 15:17:00
As I said elsewhere, that's what LiveConnect does.
Java web charts — ImageJ Plugins — Specification URLs — Java FAQs
Darren Alexandria
Ranch Hand
Joined: Aug 17, 2007
Messages: 185
posted Mar 13, 2008 19:14:00
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 ]