on click of the icon from the parent window i will popup a textarea using jquery.. I will enter text in the popup on submit i need to set the value in the form property.. I am not able to do it.. Any help would be appreciated. I am using
struts tags in
jsp.
function showPopup(){
$("#popup").dialog('open');
$("#popup").dialog({
bgiframe: false,
autoOpen:true,
resizable:true,
modal: true,
position: 'center',
height: 150,
width: 300,
buttons: {
'Cancel': function() {
$(this).dialog('close');
},
'Add/Update': function() {
$("button").click(function () {
var text = $('textarea').text();
$("justificationComments").val(text); // this line is not working. text is printed properly.
alert(text);// need to set this text value in justificationcomments property
});
$(this).dialog('close');
}
}
});
}
<form>
<img src="<%= request.getContextPath() %>/images/commentsicon.jpg" onclick="showPopup()">
<div id="popup" class="ui-widget-content ui-corner-all" title="Add Justification Comments" style="display:none" >
<html:textarea name="accounts" property="justificationComments" style="width:250px" indexed="true"/>
</div>
</form>