View Full Version : how to access elements within dialog

23 Mar 2007, 8:28 AM
We have several dialogs, and they work great, except for one problem - in firefox (everything works fantastic in IE7), we can't access ANY of the elements within the dialogs. For example, if we have a form field with an id of 'name' within a dialog, document.getElementById('name') returns null.

We've tried Ext.get('name'), we've tried document.formName.name, we've tried every damn thing we can think of.

Are we doing something wrong?


23 Mar 2007, 9:09 AM
name !== id.


myDlg.body.child("form", true).elements[name];

23 Mar 2007, 10:39 AM
Wanna hear (or read, anyway) something friggin crazy? The id of the dialog is 'fltr-dlg' (all we did was take Jack's example and rename it to fit what we were trying to do) - it simply will not work. We change the id of the dialog to 'fltrdlg' (remove the dash), and it seems to be working. We haven't fully tested it yet, and it [/i]may just be wishful thinking, but for the moment its not throwing an error message back at us.


23 Mar 2007, 10:48 AM
Another question - we have an auto-complete (combo-box) in a dialog, but firefox can't find that element, either. Any suggestions on how to get it to locate to form element?

Thanks again.

23 Mar 2007, 10:49 AM
You're not using array notation to access things by name are you?


var foo = bar[fltr-dlg];

will attempt to subtract dlg from fltr and use the result as a subscript.