| Author |
URL parameters not getting passed during javascript submit
|
Rahul somanath
Greenhorn
Joined: Jul 12, 2010
Posts: 19
|
|
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
Joined: Jan 10, 2002
Posts: 56214
|
|
|
Have you used a tool such as HttpFox to see if the parameter is actually on the request?
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Rahul somanath
Greenhorn
Joined: Jul 12, 2010
Posts: 19
|
|
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
Joined: Jan 10, 2002
Posts: 56214
|
|
|
Because this is a from submit, perhaps you should be adding the parameter as a hidden input?
|
 |
Rahul somanath
Greenhorn
Joined: Jul 12, 2010
Posts: 19
|
|
|
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
Joined: Jul 12, 2010
Posts: 19
|
|
For more clarity i am pasting the entire code here
|
 |
Rahul somanath
Greenhorn
Joined: Jul 12, 2010
Posts: 19
|
|
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.
|
 |
 |
|
|
subject: URL parameters not getting passed during javascript submit
|
|
|