Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How can I pass html form element values to applet?

 
Lee Chalupa
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a servlet application that dynamically generates an html page working.
The html page is an html form.
I'd like to add some client-side edits to validate the data.
I'd like to avoid using java script.
I'd like to use a small applet to do the validations and then use the html form to submit the data to the server.
Is this approach feasible?
Does an applet have the ability to read the values in the html form? How do I do this?
Thanks.
Lee
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi
if u r using servlet then in servlet u know those dynamic values right? now as u r writing the applet tag from the servlet to the client HTML, u can say,
out.println("<PARAM name='paramname' value='"+paramValue+"'>");
and use the PARAM tag of the applet to pass the parameters to the applet. applet can access parameters passed via PARAM tag by using getParameter() method in the Applet API...
if u r using Java Plugin based applet then u have to modify the code to have parameter in appropriate manner....
hope this helps..
regards
maulin
 
Lee Chalupa
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes I know about the params available. That won't solve my problem though. What I want to pass as parameters to the applet are the values of the form fields. How can I do this?
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
okay..
sorry, i missed the point that u wonna do validation..
u can use JSObject (netscape.javascript package) to have communication b/w the applet and javascript to pass things around but if u don't want to use JavaScript then i'm not sure how to go about the solution..
btw, why u don't want to use JavaScript?
regards
maulin
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic