Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Accessing iFrame Form Elements from parent document

nsarunnsarun Posts: 14Member
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 Posts: 439Member
    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 Posts: 14Member
    : 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.