Loosing second parameter values
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   h_kumar
Posted On:   Wednesday, January 15, 2003 12:32 PM

I am calling a JavaScript function myFunction() when onClick event takes place. myFunction() has the following code. function myFunction(){ var del = "delete"; var presCode = "presCode"; document.myForm.Action = "/myDirectory/servlet/myJSP? presCode="+presCode+"&del="+del; document.myForm.submit(); } ------------------ After invoking this function I am trying to get the parameter values in my servlet myJSP. ---------------- String presCode = request.getParameter("presCode"); String del = request.getParameter("del"); --------------- I am able to get the value parameter value for pr   More>>

I am calling a JavaScript function myFunction() when onClick event takes place. myFunction() has the following code.

function myFunction(){
var del = "delete";
var presCode = "presCode";
document.myForm.Action = "/myDirectory/servlet/myJSP? presCode="+presCode+"&del="+del;
document.myForm.submit();
}
------------------
After invoking this function I am trying to get the parameter values in my servlet myJSP.
----------------
String presCode = request.getParameter("presCode");
String del = request.getParameter("del");
---------------
I am able to get the value parameter value for presCode but not for my second parameter del. The value for del is always shown as null.
----------------
Could anybody tell me why this is happenning.

   <<Less

Re: Loosing second parameter values

Posted By:   Nitesh_Naveen  
Posted On:   Thursday, January 16, 2003 06:18 AM

The url with teh query parameters as you have here seems to be fine and you should be getting the parameters withougt any problem... juct check out your actual code, that you havent' missed out any = or & etc... Also ensure that your form's method is POST. Alternately you can pass parameters using hidden fields. You can have hidden fields with the names req. in the form and set the values just before you submit.
About | Sitemap | Contact