This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Jquery : Unable to pass vallue to the servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Jquery : Unable to pass vallue to the servlet " Watch "Jquery : Unable to pass vallue to the servlet " New topic
Author

Jquery : Unable to pass vallue to the servlet

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Hi ,

i am unable to pass a feilds value to my servlet



inside the servlet its always null , please help .


Save India From Corruption - Anna Hazare.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 30068
    
149

First, have you run an alert() to confirm the field has a value.

Also, I usually see people use data: and name/value pairs. Is it legal to make your own top level property? Here's an example of the format I'm used to seeing.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

thanks madam .
Nikhil Wanpal
Greenhorn

Joined: Apr 16, 2010
Posts: 11

Ravi Kiran Va wrote: cityName:document.getElementById('cityName').value


I dont think you can create new params to send data to server. You can use your keys but that is inside the 'data' as a url string or in JSON.
like data: {key:value},

check this out: http://api.jquery.com/jQuery.ajax/#sending-data-to-server
 
wood burning stoves
 
subject: Jquery : Unable to pass vallue to the servlet
 
Similar Threads
Java Script to clear text box
Is it possible to insert Somecontents into div tag supplied by google Visulization APIS??
Getting message as Invalid JSON
Struck up with JQuery task , unable to get custom objects as response
For Servlet request, FireFox is opening file for JSON Data