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?
bchristieAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
vladi21Connect With a Mentor Commented:
Call Javascript from a Java applet
a)Netscape only
b)Netscape AND Microsoft Internet Explorer v4+
http://ada.tactika.com/realhome/jsht/javas-j1.html#f3

Q & A - Communicating with JavaScript
http://www.inquiry.com/techtips/java_pro/answer.asp?pro=java_pro&docID=1819


NetscapeWorld - Calling Java Applets from JavaScript
http://www.netscapeworld.com/nw-05-1997/nw-05-jjscript.html

The JavaScript Security Model in Communicator 4.x
http://developer.netscape.com/docs/manuals/communicator/jssec/index.htm

Interfacing with JavaScript
http://www.buttontool.com/helpjscript.html


russian
http://sharada.sinor.ru/library/java_and_js/java_01.html

__
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.*;
import java.net.*;

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 {
      getAppletContext().showDocument
        (new URL("javascript:doAlert(\"" + msg +"\")"));
      getAppletContext().showDocument
 (new  URL("javascript:jumpTo(\"http://java.sun.com\")"));
      }
    catch (MalformedURLException me) { }
    }
  }
 



[Javascript and HTML]

<HTML><HEAD></HEAD><BODY>
<SCRIPT>
function doAlert(s) {
   alert(s);
   }
function jumpTo(tag) {
   self.location=tag;
   }
</SCRIPT>
<APPLET CODE="inJava.class"  
        NAME="myApplet"  MAYSCRIPT
        HEIGHT=400 WIDTH=10>
</APPLET>
</BODY>
</HTML>


http://developer.netscape.com/docs/examples/java/passing_params.html


Connecting JavaScript to Java with LiveConnect
http://developer.netscape.com/viewsource/smith_js2java/smith_js2java.html

Using Web Page Scripts to Communicate with Your Applet
http://msdn.microsoft.com/library/periodic/period97/html/vjp9793.htm


--
http://ada.tactika.com/realhome/jsht/javas-j1.html

JavaScript Resources
http://www.infoharvest.ab.ca/mark/javascript.html
0
All Courses

From novice to tech pro — start learning today.