Results 1 to 3 of 3
- 09-10-2011, 04:34 PM #1
Member
- Join Date
- Jul 2010
- Posts
- 24
- Rep Power
- 0
URL parameters not getting passed during javascript submit
I am doing form submit from javascript when a image is clicked. Below is the form tag in my code
<form name="tictactoe" id="tictactoe" method="GET" action="GameAction">
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.Java Code:function selection(selected){ theform = window.document.tictactoe; theform.action="GameAction?selection=selected.id"; theform.submit(); }
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.
- 09-11-2011, 09:14 AM #2
Member
- Join Date
- Jul 2010
- Posts
- 24
- Rep Power
- 0
Re: URL parameters not getting passed during javascript submit
I found the solution. I had to use the POST method to make it work.
- 10-01-2011, 08:26 AM #3
Member
- Join Date
- Oct 2011
- Posts
- 3
- Rep Power
- 0
Re: URL parameters not getting passed during javascript submit
This is somewhat confusing , can you just elaborate what was the problem and how did you solve it?
As you said it was showing null value in servlet.. The servlet might be having doGet()...(as your form method is "get").
How can it work , if you change the same to "Post"?
Similar Threads
-
hiding passed parameters using window.location.href = 'params' method
By kulangotski in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 07-01-2011, 12:49 PM -
how to pass parameters from a method to another which accepts to parameters?possible?
By amrmb09 in forum Advanced JavaReplies: 5Last Post: 11-21-2010, 02:08 PM -
entities are passed by value or passed by reference
By syntrax in forum New To JavaReplies: 1Last Post: 12-17-2009, 07:13 AM -
passing parameters to next jsp using javascript
By sridevisala in forum New To JavaReplies: 0Last Post: 11-20-2009, 05:34 AM -
Cannot get passed these syntax errors
By MrKP in forum New To JavaReplies: 1Last Post: 05-12-2008, 07:05 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks