In my jsp page I'm having some javascript code,to take all the values that are entered in textboxes. And i'm putting those in array then passing to next page. This is my javascript function
function gt2()
{
var pqr="100";
var arr=new Array();
var x=<%=height%>;
var attstr=null;
for(var t=0; t<x; t++)
{
var a="inputText"+t;
var e=document.getElementById(a);
var val= e.value;
arr[t]=val;
if(t==0)
{
attstr=arr[t]+",";
}
if((t!=x)&&(t!=0))
{
if(t==x-1)
{
attstr+=arr[t];
}
else
{
attstr+=arr[t]+",";
}
}
}
window.location.assign("gt_Iba2?value="+attstr);
}
In the second jsp page I'm getting that value.
String newValue=request.getParameter("value");
System.out.println("!###The new value in second jsp is "+newValue);
String[] allvalues=newValue.split(",");
System.out.println("The length of allvalues is "+allvalues.length);
I have five textboxes in my first jsp. My code is correctly picking the values from those textboxes and passing to other page only if it doesn't contain some special characters.

Output for above condition is fine for me.
!###The new value in second jsp is A|B|C|Dbcdrt,A|B|C|Dbcdrt,A|B|C|Dbcdrt,A|B|C|Dbcdrt,A|B|C|Dbcdrt
The length of allvalues is 5
So when I'm adding any characters like #,&,% the array is breaking.Means it is not taking other values after that character.
In this case
I have added '&' symbol on third textbox. So I'm getting output like this
!###The new value in second jsp is A|B|C|Dbcdrtdf,A|B|C|Dbcdrtdf,A|B|C|Dbcdrtdf
The length of allvalues is 3
After that '&' symbol it is not showing any value. The size is also three.If I add this in second text box the size will be two.Why this behaviour on these symbols?I need to pass those symbols also.What wrong am I doing here?I need some help
Thanks