Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

is it possible to search for a string in 2 frames using findText()

Status
Not open for further replies.

zwrley

Programmer
Aug 7, 2001
14
PH
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();
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top