Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Window property


Message #1 by "Udhayakumar. U" <udhayakumar@i...> on Wed, 22 Jan 2003 12:24:10 +0530
Hai,

	I hav some problem in creating instance of new Window

         While opening a window we are getting instance of the new window.

         In my case i will open lot of windows from the main window.

         So while validating it is giving problems to me b'coz if i open 2 
windows

         and checking whether the radio box in the window is checked or not.

         First Check the 2 windows radio box.

         Then if u uncheck any one of them it will give true only


    Here is my Code


    var intCounter = 2

    var newWindow

    var SendStr

    function OpenDisplay(reqStri)
    {

    	var pAdPr = "Check the radio"

    	var txt = 'html\n' +

    			'head\n' +

    			'titleDisplay Settings/title' +

    			'/head\n' +


    			'body bgcolor=\"#EFEFDE\"\n' +

    				'form name=\'frm\'\n' +

    				'table border=\"0\" width=\"657\" height=\"511\"\n' +

    				'tr\n' +

    				'tr\n' +

    				'td width=\"1\" height=\"80\" rowspan=\"2\"/td\n' +

    				'td width=\"214\" height=\"33\"\n' +

    				pAdPr +

    				'/td\n' +

    				'td width=\"428\" height=\"33\"input type=\"checkbox\" name=\"PrecOn\"
    value=\"ON\" onClick = \"JavaScript:window.opener.CH()\"ON/td\n' +

    				'/tr\n' +


    				'/table\n' +


    				'/form\n' +

    			'/body\n' +

    		'/html\n'

    	var Height = screen.height;

    	intCounter = intCounter + 2

    	var windowName = "HistoryDetails" + intCounter

    	if(Height > 720)
    	{
    		newWindow = window.open('',windowName,
    "width=1012,height=708,left=0,top=0");
    	}
    	else
    	{
    		newWindow = window.open('',windowName, 
"width=788,height=522,left=0,top=0");
    	}


    	newWindow.opener = self

    	var newDocument = newWindow.document

    	newDocument.write(txt)

    	newDocument.close()
    }

    function CH()
    {
    	alert(newWindow.document.frm.PrecOn.checked)
    }


  Return to Index