Link to home
Start Free TrialLog in
Avatar of Blue_Lotus
Blue_Lotus

asked on

*** Urgent - Passing a Vector from Javascript to Java in .jsp

In teh following code how do I pass the Vector from javascript to the java function (.jsp file is as follows) :

function display_onclick(pidStatus) {
var index = 0;
index = pidStatus.get(0);
   
if (index == 0 ) {
         alert("No Products");
}

Now in the javascript part I have this :
Vector pidStatus = (Vector)session.getAttribute("PID_INFO");

<td><input type="button" value="Dsiplay"
            name="ReqSubmit" onClick="display_onclick(pidStatus)"></td>
Avatar of Manish
Manish
Flag of India image

You need to iterate Vector and pass values to javascipt array.
Avatar of Blue_Lotus
Blue_Lotus

ASKER

I get an error when I pass in the value, so I am trying to see what the value is by doing this but get a syntax error :

<td>
<%out.println("<tr><td><font color='green'>"+pidStatus.get(0)+"</font></td></tr>");%>
<input type="button" value="Save"
name="ReqSubmit" onClick="save_onclick()"></td>
ASKER CERTIFIED SOLUTION
Avatar of Manish
Manish
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yes, I will accept your solution, as my js was messed up.

Thanks.
:)