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.getAttribu te("PID_IN FO");
<td><input type="button" value="Dsiplay"
name="ReqSubmit" onClick="display_onclick(p idStatus)" ></td>
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.getAttribu
<td><input type="button" value="Dsiplay"
name="ReqSubmit" onClick="display_onclick(p
You need to iterate Vector and pass values to javascipt array.
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><fo nt color='green'>"+pidStatus. get(0)+"</ font></td> </tr>");%>
<input type="button" value="Save"
name="ReqSubmit" onClick="save_onclick()">< /td>
<td>
<%out.println("<tr><td><fo
<input type="button" value="Save"
name="ReqSubmit" onClick="save_onclick()"><
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes, I will accept your solution, as my js was messed up.
Thanks.
Thanks.
:)