E
evanburen
I have an iframe inside of a page that contains a form element that I'm
trying to reference. Sometimes I get the error message
"ddlProfileNames" is null or not an object and without making any code
changes, the next time I load the page, I get no errors so I'm having
trouble finding the source of the error. If I want to reference this
select box inside the iframe, is
document.frames.frameProfileNames.frmProfileNames.ddlProfileNames the
correct way of doing it? Thanks.
<iframe src="profile.names.asp" id="frameProfileNames">
<FORM name="frmProfileNames">
<SELECT id="ddlProfileNames">
</SELECT>
</FORM>
</iframe>
<SCRIPT>
function ordering(sorder)
{
// Code here
var defaultProfile = readDefaultProfile('default');
if (defaultProfile == null)
// Code here
else
{
ordering(defaultProfile);
for (i=0;
i<document.frames.frameProfileNames.frmProfileNames.ddlProfileNames.options.length;
i++) {
if(document.frames.frameProfileNames.frmProfileNames.ddlProfileNames.options.value==
defaultProfile) {
document.frames.frameProfileNames.frmProfileNames.ddlProfileNames.selectedIndex
= i;
break;
}
}
}
</SCRIPT>
trying to reference. Sometimes I get the error message
"ddlProfileNames" is null or not an object and without making any code
changes, the next time I load the page, I get no errors so I'm having
trouble finding the source of the error. If I want to reference this
select box inside the iframe, is
document.frames.frameProfileNames.frmProfileNames.ddlProfileNames the
correct way of doing it? Thanks.
<iframe src="profile.names.asp" id="frameProfileNames">
<FORM name="frmProfileNames">
<SELECT id="ddlProfileNames">
</SELECT>
</FORM>
</iframe>
<SCRIPT>
function ordering(sorder)
{
// Code here
var defaultProfile = readDefaultProfile('default');
if (defaultProfile == null)
// Code here
else
{
ordering(defaultProfile);
for (i=0;
i<document.frames.frameProfileNames.frmProfileNames.ddlProfileNames.options.length;
i++) {
if(document.frames.frameProfileNames.frmProfileNames.ddlProfileNames.options.value==
defaultProfile) {
document.frames.frameProfileNames.frmProfileNames.ddlProfileNames.selectedIndex
= i;
break;
}
}
}
</SCRIPT>