That's easy. Every applet has a name, and this name is a property of a current document. Every public method and property of applet is still public method or property of it in Javascript. So for public method put() just use document.tstapp.put(whatever-parameters-are). About connecting Javascript and HTML form see "How to connect Javascript and HTML form". And here is an example:
Type anything in box 1 and press button. It will pass this value to the applet (gray filed) and after that get it from the applet to the field 2:
And here is the code to implement this: