Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Peter on Feb 20, 2009 00:36
open dhtmlx forum
dhtmlxWindow - Return value from window

How may I return a var inside <DIV> to my main script? I have read about [_frame.contentWindow.document.getElementById], but not sure how to use it here?

//-----DIV------
<div id="openId" style="position:relative; overflow:auto">
<script language="JavaScript">
function GetValue(form) {
var XML_Var = form.inputbox.value;
}
</script>
<form><input type="text" name="xml_path"><br><input type="submit" value="Open" onclick="GetValue(this.form)">
</form></div>

//-----Main Script-----
<script>
var dhxWins = new dhtmlXWindows();
var win_open = dhxWins.createWindow("xOpen", 0, 0, 300, 150);
win_open.setText("Open XML Report");
win_open.attachObject("openId");
</script>


Answer posted by Support on Feb 20, 2009 06:00
"_frame.contentWindow.document.getElementById" is used in case of attached url,
attachObject does not affect on local variables, just pay attention on variable scope.
variable does not store in divs, so you can use anywhere your variable (if it visible)