Form validation in an applet.

Is it possible to pass of data validation in an html form to an applet?

If so, how can i accomplish this?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Call Javascript from a Java applet
a)Netscape only
b)Netscape AND Microsoft Internet Explorer v4+

Q & A - Communicating with JavaScript

NetscapeWorld - Calling Java Applets from JavaScript

The JavaScript Security Model in Communicator 4.x

Interfacing with JavaScript


Launching an HTML document from an applet
you need to use the showDocument and AppletContext, but there is a little thing. If you are
using both the browser Netscape and IE then you sure need to do something in addition.
 add "MAYSCRIPT" in the <applet> tag
to let IE understand that you are asking the browser to do something.
This is because the JavaScripts are netscapes production, and other browser needs to know that
there will be some browser interaction.

The code:

[Java applet]

import java.applet.*;

public class inJava extends Applet{
  public void init(){
    String msg = "We will jump to a URL, you can further make that when
clicked in list or so, it goes to the URL as done in next line of code";
    try {
        (new URL("javascript:doAlert(\"" + msg +"\")"));
 (new  URL("javascript:jumpTo(\"\")"));
    catch (MalformedURLException me) { }

[Javascript and HTML]

function doAlert(s) {
function jumpTo(tag) {
<APPLET CODE="inJava.class"  
        NAME="myApplet"  MAYSCRIPT
        HEIGHT=400 WIDTH=10>

Connecting JavaScript to Java with LiveConnect

Using Web Page Scripts to Communicate with Your Applet


JavaScript Resources

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.