javascript - Best way to handle dynamically generated textarea or form to send the value to controller -
the below code creates , populates dynamically textareas. want edit value of textareas , send using ajax controller. thinking create dynamically unique ids of each textarea , somehow track id button click , submit in ajax. not sure if thats best way !
<% list<?> allcomments = (list<?>) request.getattribute("allcomments") ; if(allcomments.size()>0){ for(int = 0;i < allcomments.size(); i++ ) { comment comment = (comment)allcomments.get(i); %> <form action="editcomment.htm"> <div id="commentdiv" style="margin-bottom: 4px;" > <table style="margin-left: 40px;"><tr><td><textarea style="width: 500px; border-width:0px; background-color: #f4f4f8;"> <c:out value="<%=comment.getcomment() %>"></c:out> </textarea></td> <td><input class="commentsubmit" type="button" id="edit" name="edit" value="edit"></input></td></tr></table> </div> </form> <%}} %>
Comments
Post a Comment