Results 1 to 3 of 3

Thread: Dynamic Form Name Question...

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jul 2002
    Location
    Cleveland, Ohio
    Posts
    185

    Dynamic Form Name Question...

    Hello All,

    I have a page that is using the window.opener function to create a new form. Fine enough, except that my parent page has several forms on it with the same elements in it. How can I identify the form that was submitted to the child popup window? I have tried using this:

    window.opener.document.forms.formName

    but that doesn't seem to work.

    Any help on this would be greatly appreciated.

    Thanks,

    Jim P.
    "The Force will be with you, always."

    --Ben Kenobi--

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Dynamic Form Name Question...

    The window.opener property only references the window that opened it. Not the form. You should pass the form name from the function it was called from.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jul 2002
    Location
    Cleveland, Ohio
    Posts
    185

    Re: Dynamic Form Name Question...

    Mendhak,

    Can you give me an example of how I would do that? Here's the current function...actually, I think it's one that you posted in another posting.

    Code:
    function Insert(frmName)
    {
    	var frmName
    	var winW=500;
    	var winH=300;
    	var w=screen.width;
    	var h=screen.height;
    	var t=h/2-winH/2;
    	var l=w/2-winW/2;
    
    	var url = "price_edit.asp?Form="+frmName
    	var hWnd = window.open(url,"","top=" + t + ", left=" + l + ", width=" + winW+ ",height=" + winH+ ",resizable=yes,status=yes,scrollbars=yes,location=yes");
    
    	if ((document.window != null) && (!hWnd.opener))
    		hWnd.opener = document.window;
    }
    Thanks,

    Jim P.
    "The Force will be with you, always."

    --Ben Kenobi--

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width