give the html tag for text2  an id
the entity has a method called setFocus which will put focus there
<form  id=formwithApplet>
<input id=IDofText1 type=text>
<input  id=IDofText2 type=text>
<applet  id=applet1 onkeypress=moveOver()  ...>
</form>

<script>
 function moveOver() {

    alert( The character typed was " & applet1.event.keyCode);
    tabKey = chr(9);  // might be different based on encoding
    keyPressed = applet1.event.keyCode;
    if (tabKey == keyPressed) {
          IDofText2.focus();   //let us get out of here
          event.returnValue=false;  //cancels event bubbling
    }
    else {
        // just entering information in the applet
       event.returnValue=true ;
    }
    return  keyPressed;
 }

</script>
Jay A. Schmitendorf
----- Original Message -----
From: "Philippe Bertramo" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 15, 2000 5:47 AM
Subject: OFF-TOPIC : Applet and Javascript communication


> Very sorry to post an off topic, but I can't refrain as I can't find a
> Javascript group that look as good as this present group.
> Do you forgive me if I tell that this questions comes from a servlet
project
> and that it's in line with former discussions about validation ?
>
> So, to the point :
> For client side data entry I developped a java applet that I use as an
input
> field in an html form, to be submitted to a servlet.
> I did this because the user experience can be enhanced, like a combo box
or
> something more sophisticated, but I face some integration problem between
> this applet and the other fields.
>
> My form looks like
> <form>
> <input text1>
> <applet1>
> <input text2>
> </form>
>
> When I am on the text1 field and press tab, I jump to text2, where I would
> like to jump to the applet.
>
> I solved this problem by writing a piece of code for text1.onBlur.
> But now when I am on the applet an press tab I want to go to text2, and I
> couldn't find out how to do it.
>
> Briefly what I did was :
> - capture the tab key in the applet
> - get the JSObject for the window
> - get the JSObject for the document
> - call a function on the document that shows an alert (it works) and call
> text2.focus().
>
> and then:
> The cursor is still on the applet.
>
> If somebody is interested I can give more info, like code bits ...
>
> Thanks in advance,
> Philippe
>
> = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
> Philippe Bertramo
> World Customs Organization
> Brussels - Belgium
>
>
> -----Original Message-----
> From: Steve Reich [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, November 14, 2000 07:20
> To: '[EMAIL PROTECTED]'
> Subject: RE: Automated Printing...
>
>
> I don't think you can do this... at least not with JavaScript. It's the
> nature of Windows (I'll assume that's your OS) to prompt before printing.
> Also, if the user doesn't have Acrobat, the file extension won't be
> recognized. Thirdly, the document needs to be opened before it is printed
> (another "feature" of Windows).
>
> You can print from JavaScript.... here's a print button for your page....
>
> <input type="button" value="Print Page" onclick="window.print()">
>
> ....but it sounds like you are asking too much of current web technology
to
> do what you are asking.
>
> HTH,
> Steve
>
> -----Original Message-----
> From: Jarrod B [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, November 14, 2000 1:00 AM
> To: [EMAIL PROTECTED]
> Subject: Auotomated Printing...
>
>
> Hi, I have the following problem.
>
>
> I want to set up a page with a list of PDF's and corresponding Check
> Boxes.
>
> The user can click in the multiple check boxes and then hit a print
> button.
>
> I want to then print all the pdf's which are checked without
> prompting the user.
>
> Any help on the javascript to do the printing would be great.
>
> Thanx.
>
>
> _____________________________________
>
>
>
>
> = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
> Philippe Bertramo
> World Customs Organization
> Brussels - Belgium
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html
>
>
___________________________________________________________________________
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff SERVLET-INTEREST".
>
> Archives: http://archives.java.sun.com/archives/servlet-interest.html
> Resources: http://java.sun.com/products/servlet/external-resources.html
> LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to