Debugging an Error Message

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top