Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Srimanta on Jul 22, 2009 14:15
open dhtmlx forum
How to access the value from popup window

I have a main window and a button to launch a popup edit box to add/edit a record from the grid in my main window

I don't have iframe. I am attaching a HTML string which is generated dynamically similar to the <div> below. If I type something I want to show when I click button show. how I can access, name & lastname once I type something in the popup.

Also how I can transfer the record to the grid in the myWindow?

<div id="editForm" style="display: none;">
<table width="90%">
<tr>
<td>
<div>
<div id="obj" style="font-family: Tahoma; font-size: 10px; height: 100%; overflow: auto; background-color: #FFFFFF;">
<table width="100%" style="margin-top: 10px;">
<tr>
<td width="100" align="right">First Name:</td>
<td><input id="name" type="text"></td>
</tr>
<tr>
<td align="right">Last Name:</td>
<td><input id="lastname" type="text"></td>
</tr>
<tr>
<td colspan="2" align="center"><input id="b1" type="button" value="Show Input" onclick="showInputl();> <input type="button" value="Cancel" onclick="onW1Cancel();"></td>
</tr>
</table>
</div>
</div>
</td>
</tr>

</table>
</div>

function createPopup(){
     w1 = myWindow.createWindow("w1", 200, 120, 600, 300);
     w1.attachObject('editForm', true);
}

function showInput(){
alert(myWindow.window("w1").getElementById("name").value);
}
Answer posted by Alex (support) on Jul 23, 2009 01:25

Hello, 

as you don't use iframes inside window, you can use the common js appoach to get element value:

function showInput(){ 
alert(document.getElementById("name").value); 
}