Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 03-20-2009, 05:23 AM   PM User | #1
yesosuresh
New to the CF scene

 
Join Date: Mar 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
yesosuresh is an unknown quantity at this point
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
yesosuresh is offline   Reply With Quote
Old 03-20-2009, 06:50 AM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,200
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
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.
Old Pedant is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:27 PM.


Advertisement
Log in to turn off these ads.