aspose file tools
The moose likes HTML, CSS and JavaScript and the fly likes Get the input box value from applet & transfer it to javaScript Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Reply Bookmark "Get the input box value from applet & transfer it to javaScript" Watch "Get the input box value from applet & transfer it to javaScript" New topic
Author

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

Darren Alexandria
Ranch Hand

Joined: Aug 17, 2007
Posts: 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
Marshal

Joined: Mar 22, 2005
Posts: 35258
    
    7
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().


Android appsImageJ pluginsJava web charts
Darren Alexandria
Ranch Hand

Joined: Aug 17, 2007
Posts: 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
Marshal

Joined: Mar 22, 2005
Posts: 35258
    
    7
As I said elsewhere, that's what LiveConnect does.
Darren Alexandria
Ranch Hand

Joined: Aug 17, 2007
Posts: 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 ]
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Get the input box value from applet & transfer it to javaScript
 
Similar Threads
Regarding document object in javascript
jsf and javascript
getting the value of the select list
Problems when initiating applet for jre1.4.2 when jre1.5 is on the client
Getting the value of the select box in a textbox