• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

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

 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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().
 
Darren Alexandria
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I said elsewhere, that's what LiveConnect does.
 
Darren Alexandria
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
We don't have time for this. We've gotta save the moon! Or check this out:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic