Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Accessing iFrame Form Elements from parent document

nsarunnsarun Member Posts: 14
Enlightened Ones,

Can anyone of you help me with this....

My html document has an iframe in it. the iframe has a form and hence form elements. I would like to access the iframe form elements from the parent document. can anyone help me please....

I am trying to do something like this in my parent doc. 'userlist' is the iFrame id. 'shwusr' is the form.

var obj=document.getElementById('userlist').shwusr.useridx;

But it says useridx is a null object!!

Thanks tons in advance.

Arun

Comments

  • WeirdofreakWeirdofreak Member Posts: 439
    Assuming shwuser and useridx are the names, not ids, try
    document.getElementById('userlist').document.forms.shwusr.elements.useridx

    If that doesn't work, you could try without the document, but I think you'll need it.
  • nsarunnsarun Member Posts: 14
    : Assuming shwuser and useridx are the names, not ids, try
    : document.getElementById('userlist').document.forms.shwusr.elements.useridx
    :
    : If that doesn't work, you could try without the document, but I think you'll need it.
    :


    Yes both are names. It didnt work both ways!! I dont know what the problem is. It yields a null object.

    Thanks much for your help any ways.

    Arun
Sign In or Register to comment.