G
gargoyle47
I want to use an HTML form incorporating JavaScript and also a Java
applet.
My idea is to have text entered in a webform, captured by the JS and
then a Java applet called with the form text as the input argument.
The applet will then manipulate the text and return a string back to
JS for additional processing before being submitted as web form mail.
I know how to invoke the applet from JS with input text:
document.myApplet.newText(tempText) // invokes method in Java class
and in the Java class:
public void newText(String s) {
this.whatToSay = s;
etc.
}
but what I don't know how to do is return a string from Java back to
the JS, i.e. how to capture the returned string using JS.
Can somebody please help?
Thanks
applet.
My idea is to have text entered in a webform, captured by the JS and
then a Java applet called with the form text as the input argument.
The applet will then manipulate the text and return a string back to
JS for additional processing before being submitted as web form mail.
I know how to invoke the applet from JS with input text:
document.myApplet.newText(tempText) // invokes method in Java class
and in the Java class:
public void newText(String s) {
this.whatToSay = s;
etc.
}
but what I don't know how to do is return a string from Java back to
the JS, i.e. how to capture the returned string using JS.
Can somebody please help?
Thanks