• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 185
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic