*
The moose likes Struts and the fly likes please help me to pass form bean values to the script function Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply locked New topic
Author

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

suresh sai
Ranch Hand

Joined: Jul 16, 2007
Posts: 62
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
Marshal

Joined: Mar 22, 2005
Posts: 41060
    
  43
Duplicate of http://www.coderanch.com/t/57535/Struts/please-help-me-pass-form.


Ping & DNS - my free Android networking tools app
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: please help me to pass form bean values to the script function
 
Similar Threads
JavaScript & JSP Please help
JavaScript Validation in struts
Having trouble with javascript ...
How to submit multiple records in one trip
please help me to pass form bean values to the script function