is it possible to search for a string in 2 frames using find

admin

Administrator
Staff member
I have 2 frames (say, mainFrame and bottomFrame) and in both frames I am dynamically creating tables with data. In one of my menu options, I am giving the user privilege to search for a string but it is searching only through one frame. Is it possible to search through the mainFrame first then if no more occurrences found search through the bottomFrame.

This is how I wrote the code:

if (TRange!=null)
{
TRange.collapse(false)
strFound=TRange.findText(str)
if (strFound)
TRange.select();
}
if (TRange==null || strFound==0)
{
// this is my checkbox where user ticks if he wants it case sensitive or not
var isCaseSen = (document.form1.chkCase.checked) ? 4:0
TRange = parent.mainFrame.document.body.createTextRange()
strFound=TRange.findText(str, 10000, isCaseSen)
if (strFound)
TRange.select();

TRange = parent.bottomFrame.document.body.createTextRange()
strFound=TRange.findText(str, 10000, isCaseSen)
if (strFound)
TRange.select();
}
 
Back
Top