Hi everybody,
In Ted Husted's
Struts Tips site,
<html:hidden property="dispatch" value="error"/>
<SCRIPT>function set(target) {document.forms[0].dispatch.value=target;}</SCRIPT>
<html:submit onclic="set('save');">SAVE</html:submit>
<html:submit onclic="set('create');">SAVE AS NEW</html:submitl>
<html:submit onclic="set('delete);">DELETE</html:submit>
one part of the tutorial shows a way to use javascript to set value in ActionForm. Smart. I wanted to try the same thing and ran into a problem:
<script>
function set(target) {
document.forms[0].source.value = target;
}
</script>
...
<html:hidden property="source" value="notSet" />
...
<logic:iterate id="content" name="myBean" property="myProp" indexId="idx">
...
<html:submit onclic="set('<%=idx%>');" property="buttonName" value="another value" />
...
</logic:iterate>
I want to use logic:iterate tag's indexId attribute to make that call.
The result is that everyting, including <% tag, shows up same as the source code. I tried converting indexId to int, again to
String, and everything I can think of. Still no good result.
Is there any way to achieve this?
I appreciate your suggestions and comments.
Thank you.