File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes how to get input from javascript and pass to servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "how to get input from javascript and pass to servlet" Watch "how to get input from javascript and pass to servlet" New topic
Author

how to get input from javascript and pass to servlet

dineshiop kumar
Greenhorn

Joined: Mar 05, 2009
Posts: 13
could any body say me how to get input from javascript and pass to servlet

i would like to get the username and password into servlet
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

You don't need to pass this from JavaScript, the values are in your form. Once you've submitted this form you will be able to read them off the request.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Leinad Jan
Greenhorn

Joined: Feb 18, 2009
Posts: 28
Hello,


If you want to send your data to a servlet, you'll need a form. In your form, you will declare an action. The action should be the path to your servlet.

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60053
    
  65

Leinad Jan wrote:If you want to send your data to a servlet, you'll need a form.

He already has a form.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Leinad Jan
Greenhorn

Joined: Feb 18, 2009
Posts: 28
Bear Bibeault wrote:
Leinad Jan wrote:If you want to send your data to a servlet, you'll need a form.

He already has a form.


Yes, he does have a form, but it has no action. If you have no action, you can't send your form away.
Carol Enderlin
drifter
Ranch Hand

Joined: Oct 10, 2000
Posts: 1364
I don't see username or password in any of that code.
sree_prasad
Greenhorn

Joined: Nov 21, 2007
Posts: 8
The code does not contain any username and password that needs to be submited.
 
jQuery in Action, 2nd edition
 
subject: how to get input from javascript and pass to servlet
 
Similar Threads
how to transfer data from javascript to jsp
javascript to jsp(i am sorry to post it once again please see the code i have everything ut does not
how to send sms in jsp web application
calling jsp page using Jquery
Clear email field after submit