This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
    Bookmark Topic Watch Topic
  • New Topic

String array in form

 
basha khan
Ranch Hand
Posts: 516
  • Mark post as helpful
  • send pies
  • Report post to moderator
I have an ActionForm in struts-config for eg,

<form-bean name="SomeForm" >
<form-property name="stringsSelected" type="java.lang.String[]" />
</form-bean>

In JSP, i am creating a hidden field for this property like,

<html:hidden property = "stringsSelected"/>

Now i want to to pass a javascript string array using this form property fuch as

<script type="javascript">

function aFunct(){

document.forms[0].stringsSelected.value = myJSStringArray;

//OR

document.forms[0].stringsSelected = myJSStringArray;

}
</script>

If property stringsSelected is a string instead of string [] it works, for String array it does'nt.

Is there any way to send a javascript arry to server using forms?.

Thanks,
Basha
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64700
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Report post to moderator
Please do not cross-post the same question in more than one forum.
 
    Bookmark Topic Watch Topic
  • New Topic