Bookmark Topic Watch Topic
  • New Topic

please help me to pass form bean values to the script function

 
suresh sai
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Report post to moderator
Hi All.,

I need to pass the form bean (struts) String array values to the script function.I have tried all the ways which I know.But I didnt get the solution.Here I am showing the scenario in short.

MyForm.java
-------------

private String records[]; and their getters and setters.

MyJsp.jsp
------------
<script>
function toDoList(records)
{
..........
return true;
}
</script>
<body onloadfunction="return toDoList(records)">
<html:form>
<html:hidden property="records">
</html:form>
</body>
for this one I am getting java script error---- records undefined.
and also
<body onloadfunction="return toDoList(<%= session.getAttirbute("records")%> ">
for this one I am getting java script error---- ] expected at <body>
but the values are setting in to the bean in both ways
and in another one I am getting null like that.
Please help me to solve the problem.
Thanks in advance.
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
 
    Bookmark Topic Watch Topic
  • New Topic