I am trying to post an array of JavaScript into an array of Strings in Java. It goes like this...
My JavaScript code:
var quantity_arr = new Array();
for (var i=0; i< <%= cart.size() %>; i++) {
quantity_arr[i] = document.getElementsByClassName("quantity")[i].value;
}
xmlhttp.send("sum_of_order="+sum_of_order+"&credits_number="+credits_no+"&credit_card_number="+credit_card_number+"&quantity_arr="+quantity_arr);
This is my Java code:
String[] myParams =new String[cart.size()];
String order_id=Integer.toString(temp);
String customer_id="'"+session.getAttribute("user_id")+"'";
String date= "15/29/12";
String sum=request.getParameter("sum_of_order");
String credit_card= "'"+request.getParameter("credit_card_number")+"'";
String credits="'"+request.getParameter("credits_number")+"'";
myParams = request.getParameterValues("quantity_arr");
All the params works fine except the myParams array
that gets nothing. Can someone help me with this?