learner
08-19-2002, 06:23 PM
Hi,
I am facing a problem with onBlur function in a frame in netscape.
I have html file
frame.html
This html file containe 2 frames space.html,splitme.html
Here is the code
frame.html
************
<html>
<head>
</head>
<frameset rows="50,50">
<frame src="split.html">
<frame src="space.html">
</frameset>
</html>
*****************
space.html
*****************
<html>
<head>
<script>
function CheckIt(X,ABC){
a=0;
FL=ABC.slice(0,1);
LL=ABC.slice(ABC.length-1,ABC.length);
if(FL==" "){ABC=ABC.slice(1,ABC.length);a=1;}
if(LL==" "){ABC=ABC.slice(0,ABC.length-1);a=1;}
X.value=ABC;
if(a!=0){CheckIt(X,ABC)}
}
function stripSpace(obj)
{
var text = obj.value.replace(/^[\s]/,'');
obj.value = text;
}
</script>
</head>
<body>
<form name="FormName">
<input type="text" onBlur="javascript:alert('Hifromsecondframe')" name="AName" size="12">
<input type="text" onBlur="javascript:alert'Hellofromsecondframe')" name="AName" >
</form>
</body>
</html>
***********************
splitme.html
*****************
<html>
<head>
</head>
<body>
<form name=temp>
<input type="hidden" name="hiddenValue" value="22">
<input type="text" name="hiddenIndex" value="0,1,2,">
<a href="java script:selectagbrwin()";>Select One</a>
<a href="java script:alert(splitMe());">Test</a>
<input type="text" name="a1" >
<input type="text" name="a2" >
</form>
</body>
</html>
**************
what happens in netscape is that after the 2 frames are loaded
when i place the focus in the first textbox in the second frame and after that when click outside the document the onBlur event is called and the alert comes but in an infinite loop.same thing nhappens if i place the cursor in the nsecond textbox and click outside the alert comes in an infinite loop.Is it due to frames or some opther problem.Everything is fine with IE
Thanks
learner
I am facing a problem with onBlur function in a frame in netscape.
I have html file
frame.html
This html file containe 2 frames space.html,splitme.html
Here is the code
frame.html
************
<html>
<head>
</head>
<frameset rows="50,50">
<frame src="split.html">
<frame src="space.html">
</frameset>
</html>
*****************
space.html
*****************
<html>
<head>
<script>
function CheckIt(X,ABC){
a=0;
FL=ABC.slice(0,1);
LL=ABC.slice(ABC.length-1,ABC.length);
if(FL==" "){ABC=ABC.slice(1,ABC.length);a=1;}
if(LL==" "){ABC=ABC.slice(0,ABC.length-1);a=1;}
X.value=ABC;
if(a!=0){CheckIt(X,ABC)}
}
function stripSpace(obj)
{
var text = obj.value.replace(/^[\s]/,'');
obj.value = text;
}
</script>
</head>
<body>
<form name="FormName">
<input type="text" onBlur="javascript:alert('Hifromsecondframe')" name="AName" size="12">
<input type="text" onBlur="javascript:alert'Hellofromsecondframe')" name="AName" >
</form>
</body>
</html>
***********************
splitme.html
*****************
<html>
<head>
</head>
<body>
<form name=temp>
<input type="hidden" name="hiddenValue" value="22">
<input type="text" name="hiddenIndex" value="0,1,2,">
<a href="java script:selectagbrwin()";>Select One</a>
<a href="java script:alert(splitMe());">Test</a>
<input type="text" name="a1" >
<input type="text" name="a2" >
</form>
</body>
</html>
**************
what happens in netscape is that after the 2 frames are loaded
when i place the focus in the first textbox in the second frame and after that when click outside the document the onBlur event is called and the alert comes but in an infinite loop.same thing nhappens if i place the cursor in the nsecond textbox and click outside the alert comes in an infinite loop.Is it due to frames or some opther problem.Everything is fine with IE
Thanks
learner