Assign hidden value using Struts2 tag
How assign the hidden value using Struts tag inside of iteration. My JSP code looks like this:
<s:iterator value="collegelist">
<s:hidden name="hiddenname" value='<s:property value="collegename"/>'/>
</s:iterator>
It takes hidden field's value as a string it show on alert:
<s:property value="collegename"/>
JavaScript code:
var text = myForm.hidde开发者_JS百科nname.value;
alert(text);
<s:iterator value="list">
<s:hidden name="hidden" value="%{property}" />
</s:iterator>
精彩评论