This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URL parameters not getting passed during javascript submit

 
Rahul somanath
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am doing form submit from javascript when a image is clicked. Below is the form tag in my code

The image is present in the form tag. When i click the image i call a java script method shown below


The problem I am facing is the page gets submitted but i am not able to receive the parameter "selection" in the server.
request.getParameter("selection") is coming as null.

It would be great if someone would help in resolving this problem. I tried googling but didn't get a solution.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64858
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you used a tool such as HttpFox to see if the parameter is actually on the request?
 
Rahul somanath
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Bear Bibeault . Thanks a lot for coming forward to help me.

I used httpFox. There is no parameter passed in the URL
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64858
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Because this is a from submit, perhaps you should be adding the parameter as a hidden input?
 
Rahul somanath
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I not able understand why i should pass it as hidden parameter. I am trying to pass the parameters in the url. Can you please explain this and why and how to pass it as hidden parameter
 
Rahul somanath
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For more clarity i am pasting the entire code here

 
Rahul somanath
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found the solution. I changed the form method from GET to POST. for the parameters to get passed.
I would be great if someone could explain me why doesn't GET method doesn't work.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic