Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Error- Multiple popups crashes IE while trying to pass value between two windows

    Hi friends,

    I've lost almost half a day to identify/recover this script error.I often got this type of error.

    I've parent window with two text field.There user can either enter the value on the field or choose popup option to search & select the value.When user open the popup & selects value, the selected value gets populated to parent window text field & close popup window. Everything working well, but sometimes after closing popup window, it keeps on opening same popup window multiple time until my internet explorer get crashed. It happens only in IE.

    Here is the snippet of parent window:
    Code:
    <SCRIPT language="Javascript">
    function winpop(stringURL) {
    	var pop_window = window.open (stringURL, 'popWin', 'scrollbars=yes,status=yes,top=10,width=750,height=650,location=no,menubars=no,toolbars=no,resizable=no');
    	if (window.focus) {pop_window.focus()}
    	return void(0);
    }
    </SCRIPT>
    
    <body>
    
    <form name="GetClntAcctForm" method="post" action="/JFactors/FAGetClntAcct.do?do=get" onsubmit="return validateGetClntAcctForm(this);">
    	
    	<input type="hidden" name="tranType" value="">
    	<input type="hidden" name="showFactor" value="N">
    	<input type="hidden" name="programId" value="">
        <table class="tablestyle1" border="0" cellpadding="3" cellspacing="1" width="100%">
            <tbody>        
                <tr>
    				<td class="labelstyle1">Client Account </td>
    				<td class="inputstyle1">
    					<input type="text" name="clnt" maxlength="10" size="15" value="" style="text-transform: uppercase">&nbsp;
    					<input type="text" name="acct" maxlength="6" size="15" value="" style="text-transform: uppercase">&nbsp;
    					<a  href="javascript:winpopup('popup.html?parent=GetClntAcct&search='+document.forms[0].clnt.value+'&type=8&acct='+document.forms[0].acct.value);">
    						<img src="/JFactors/images/search.gif" height="18" width="18" border="0" alt="Search"></a>	
    						<input type="submit" value="Go" class="btnstyle1">
    				</td>            	
                </tr>
            </tbody>
        </table><br/>
    	
    </form>
    </body>
    Here is the snippet of popup.html

    Code:
    <SCRIPT language="Javascript">
    
    function closepop(parentName, stringParam) {
    	 if ((parentName == "GetClntAcct")) {
    	     window.opener.document.GetClntAcctForm.clnt.value = stringParam.substring(0, stringParam.indexOf(";clntacct;"));
       	     window.opener.document.GetClntAcctForm.acct.value = stringParam.substring(stringParam.indexOf(";clntacct;")+10, stringParam.indexOf(";clntname;"));
    		 
    	window.opener.focus();
    	window.close();
    
    }
    </SCRIPT>
    
    <body>
    		<fieldset/>
    				
    		<form name="ClientAcctForm" method="post" action="/JFactors/FAClientList.do">
    		<h1>select a Client:</h1>
    		<BR>
    		<table class="tablestyle1" border="0" cellpadding="3" cellspacing="1" width="100%">		
    		
    		       <tbody>
    		        <tr class="labelstyle1">
    					<td>Client Account </td><td>Client Name</td>
            		</tr> 
            		        
    						<tr class="disprecstyle1 ">
    							<td>      
            						<a href="#" onclick="javascript:closepop('GetClntAcct','AZU397;clntacct;D2RSGD;clntname;AZU397     Long Name;status;null')">AZU397&nbsp;D2RSGD</a>              	                	      	                	    	                    	
    		                    </td><td>AZU397     Long Name</td>		        
    		                  </tr>
    						
    						<tr class="disprecstyle2 ">
    							
            					<td>      
            						<a href="#" onclick="javascript:closepop('GetClntAcct','AZU397;clntacct;E2RSGD;clntname;AZU397     Long Name;status;null')">AZU397&nbsp;E2RSGD</a>              	                	      	                	    	                    	
    		                    </td><td>AZU397     Long Name</td>		        
    		                  </tr>
    		            	
    				        
    						<tr class="disprecstyle1 ">
    							
            					<td>      
            						<a href="#" onclick="javascript:self.close();">AZU397&nbsp;D1NSGD</a>              	                	      	                	    	                    	
    		                    </td><td>AZU397     Long Name</td>		        
    		                  </tr>
    		       </tbody>
    		</table>
    		</form>
    </body>
    Please split some tips to recover this error.

    Thanks.
    Suresh

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,111
    Thanks
    75
    Thanked 4,335 Times in 4,301 Posts
    Need to first track down what code is *DOING* the multiple opens.

    You might put an alert( ) just in front of any window.open you are doing, so you can see if you are getting unexpected calls to that particular window.open.


  •  

    Posting Permissions

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