I was hoping someone could help me with a problem I am having.

I am using Javascript to pass values back from a popup window to the calling webpage like so:

window.opener.document.forms[0].txtName.value = document.forms[0].txtName.value;

This works just fine, except when the opening webpage has more than one form on it, then I would have to explicitly call the form by it's name rather than the subscript 0.

What I was hoping to do was to programmatically retrieve the name of the form the element resides on so that it wouldn't matter what the form name was called.

Is there anyway to do this?

Thanks