You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Namasivayam, Sudhakar (Cognizant)" <NS...@chn.cognizant.com> on 2004/04/02 13:28:43 UTC
Form submission - Array of hidden fields with large values...
Hi,
I have a page in which i need to update a "TEXTAREA" when a combo value is changed.
Previoiusly i populated a array to have the test for each combo value.
var desc = new Array(
<logic:iterate name="desc" id="b">
<%if(icount!=0){%>,<%}%>
"<bean:write name="b"/>"
<%icount++;%>
</logic:iterate>
);
Now if there was any "enter" character then i get a java script error(unterminated string constant). Now i modified my code to...
<html:form>
..
..
..
<input type="hidden" name="desc" value = "">
<logic:iterate name="desc" id="c">
<input type="hidden" name="desc" value = "<bean:write name="c"/>" >
</logic:iterate>
</html:form>
btw..
the java script function goes like this ...
iIndex = document.forms[0].combo.selectedIndex;
document.forms[0].textarea1.value= document.forms[0].desc[iIndex+1].value;
But these values need not be posted on the form submission. Will this cause any problem(Large data)?? Any other simple solution???
Thank you very much,
sudhakar
PS :I have not used <html:hidden />