Win a copy of Machine Learning with R: Expert techniques for predictive modeling this week in the Artificial Intelligence and Machine Learning forum!
    Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

send a form data using ajax

 
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Report post to moderator
how will send a form data using ajax.
when i click submit button request is not going at server.
i want to send request using data.

 
Marshal
Posts: 67289
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Report post to moderator
It's be much easier, and a lot more robust, to use jQuery to do your Ajax. it not only makes the Ajax calls easier, it can gather the form data for you.

P.S. When you post code, make sure that it is properly indented.
 
Ritesh raushan
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Report post to moderator

Bear Bibeault wrote:It's be much easier, and a lot more robust, to use jQuery to do your Ajax. it not only makes the Ajax calls easier, it can gather the form data for you.

P.S. When you post code, make sure that it is properly indented.




sorry Bear i don't know JQuery.
 
Bear Bibeault
Marshal
Posts: 67289
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Likes 1
  • Mark post as helpful
  • send pies
  • Report post to moderator
You didn't know Java at one time either. Practically no one does Ajax "by hand" these days. There are too many nuances and pitfalls. If you are serious about your craft, you need to continue to learn new things and the best way to go about things.

But, if you want to continue on your current path, I'd recommend opening the debugging tools in the browser and stepping through the code to see where it's going awry.
 
Saloon Keeper
Posts: 21139
134
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Report post to moderator
One of the best reasons for using jQuery is that it smooths out many of the warts in JavaScript. Since JavaScript is notorious for having critical differences between not only browsers, but browser versions, jQuery provides a way for coding more of a "write-once/run-anywhere" script without having to spend a lot of time and effort.
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Report post to moderator

Bear Bibeault wrote:It's be much easier, and a lot more robust, to use jQuery to do your Ajax. it not only makes the Ajax calls easier, it can gather the form data for you.

P.S. When you post code, make sure that it is properly indented.



Hi,
I used jQuery to send data from ajax to servlet. It was working fine when I was working on eclipse.
But when I tried to use these code on other server, I am getting 404 error.
I think this error is mainly because of unable to map my servlet class with the URL given in ajax.
I used web.xml in the eclipse but I also copied this file to server but it still not working.
Please help me regarding this.

Thank you
 
Bear Bibeault
Marshal
Posts: 67289
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not post the same question more than once.
 
I am mighty! And this is a mighty small ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!