Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Matthieu Hendriks on Dec 11, 2008 10:46
open dhtmlx forum
Problem in getting a field value in firefox and Chrome , in IE it works ok.

I have in my main page the following function defined:

function getField(wid,field) {
if (_isIE) {
alert(dhxWins.window(wid)._frame.contentWindow.document.getElementById(field).value);
} else {
alert(dhxWins.window(wid)._frame.contentDocument.getElementById(field).value);
}
}


After creating 2 aditional windows and calling "parent.getField(WindowId, FieldName);" to get the value of a
<input type="text" name="FieldName"> ..

In IE I get the correct value of the field, in Firefox and in Chrome I get a

dhxWins.window(wid)._frame.contentDocument.getElementById(field) is null

What ám I doing wrong? Help is very appreciated.

Answer posted by Richard van der Burg on Dec 12, 2008 07:17

I had the same problem.

<input type="text" name="FieldName">  has no id. Use <input type="text" id="FieldName" name="FieldName"> instead. name-attribute is used as label.

Answer posted by Matthieu on Dec 12, 2008 07:37
Thanks for the quick response. great!