I'm trying to get the value that was entered in a textarea in a modal window to place it in on a form.
Situation is as follows:
We have a jsp page with a number of textBoxes on them. The textboxes are non smartclient, but struts html:text boxes.
Next to each textbox there is an icon. When clicking on the icon a popup should appear with a textarea in it and an "Ok" and "Cancel" button.
When clicking on the "Ok" button the value that was entered in the textarea should be placed in the textbox on the form.
Showing the popup works fine, but how can I get the value from the textarea in the modal window and place it on the form?
And clear the value from the textArea afterwards?
Some code snippets:
The text boxes on the form with the image:
When clicking on the image the following function is executed:
In this function I would also set a hidden value on the form so I know which icon was clicked. So I can place the value from the textarea in the correct text box afterwards.
This is the modalWindow:
And this is the closePopup function:
In this function I would like to get the value from that modal window, place it in the correct textbox on the form and clear the textarea.
But how can I get the value from that textArea and clear it afterwards?
Situation is as follows:
We have a jsp page with a number of textBoxes on them. The textboxes are non smartclient, but struts html:text boxes.
Next to each textbox there is an icon. When clicking on the icon a popup should appear with a textarea in it and an "Ok" and "Cancel" button.
When clicking on the "Ok" button the value that was entered in the textarea should be placed in the textbox on the form.
Showing the popup works fine, but how can I get the value from the textarea in the modal window and place it on the form?
And clear the value from the textArea afterwards?
Some code snippets:
The text boxes on the form with the image:
Code:
<html:text name="advancedTechSpecOverviewForm" property="value[${currentNode.id}]"/> <html:img src="/a2p/images/edit.png" onclick="showPopup();" altKey="techSpecManagement.button.edit" border="0" align="absbottom"></html:img>
Code:
function showPopup(){ modalWindow.show(); }
This is the modalWindow:
Code:
isc.Window.create({ ID: "modalWindow", title: "Enter value", autoSize:true, autoCenter: true, isModal: true, showModalMask: true, autoDraw: false, items: [ isc.DynamicForm.create({ autoDraw: false, height: 48, width: 350, padding:4, name: "popup", fields: [ { name: "value", type: "textArea", width: "300", align: "left" }, {type: "button", title: "Ok", click: "closePopup(this);" }, {type: "button", title: "Cancel", click: "closePopup(this);" }, ] }) ] });
Code:
function closePopup(obj){ if(obj.title == "Ok"){ alert("ok"); }else if(obj.title == "Cancel"){ alert("cancel"); } modalWindow.hide(); }
But how can I get the value from that textArea and clear it afterwards?
Comment