By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,023 Members | 1,297 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,023 IT Pros & Developers. It's quick & easy.

Invoking the browser's find dialogue

P: n/a
Just a quickie. Is there a way to cause a browser to open it's
find... dialogue in response to an event, say a click on a button?

The idea is that there's a list of addresses that a client has used
for delivery in the past, but in some cases this list can be rather
long, and a lot of clients don't know about the browser find in page
dialogue.

I'd imagine getting the browser to generate it's own ctrl-f event
would be impossible, but is there a way to trigger the window (or
search bar in Firefox's case) directly from within javascript? My
search of the group turned up results that only seemed pertinent to
very old browsers, and i need something that will work in IE6 and
FireFox as a bare minimum.
Nov 16 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
On Nov 16, 12:12 pm, Gordon <gordon.mc...@ntlworld.comwrote:
Just a quickie. Is there a way to cause a browser to open it's
find... dialogue in response to an event, say a click on a button?
I very much doubt that such a mechanism exists...
>
The idea is that there's a list of addresses that a client has used
for delivery in the past, but in some cases this list can be rather
long, and a lot of clients don't know about the browser find in page
dialogue.
You could add a footnote to this page, suggesting "use Edit->Find in
this page"...
>
I'd imagine getting the browser to generate it's own ctrl-f event
would be impossible, but is there a way to trigger the window (or
search bar in Firefox's case) directly from within javascript? My
search of the group turned up results that only seemed pertinent to
very old browsers, and i need something that will work in IE6 and
FireFox as a bare minimum.
Not exactly the mechanism you ask for, but this page:
http://www.nsftools.com/misc/SearchAndHighlight.htm
prompts for a string, then highlights it in the page.

K.

Nov 16 '07 #2

P: n/a
Gordon said the following on 11/16/2007 12:12 PM:
Just a quickie. Is there a way to cause a browser to open it's
find... dialogue in response to an event, say a click on a button?
Not that I have ever been able to find in IE. If you are going to add a
button to the page, why not just put a note on the page telling how to
invoke the find dialog box? F3 key does the same thing as Ctrl-F does.
The idea is that there's a list of addresses that a client has used
for delivery in the past, but in some cases this list can be rather
long, and a lot of clients don't know about the browser find in page
dialogue.
Put a note on the page and educate them :)

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 16 '07 #3

P: n/a
Gordon wrote:
Just a quickie. Is there a way to cause a browser to open it's
find... dialogue in response to an event, say a click on a button?

The idea is that there's a list of addresses that a client has used
for delivery in the past, but in some cases this list can be rather
long, and a lot of clients don't know about the browser find in page
dialogue.

My search of the group turned up results that only seemed pertinent to
very old browsers, and i need something that will work in IE6 and
FireFox as a bare minimum.
Maybe you are looking for

window.find()

That is a feature of DOM Level 0 and therefore supported not only in
Netscape 4.x, the "very old browsers" you probably mean, but also in
Gecko-based UAs like Firefox. See also

http://www.google.com/search?q=window.find+IE

Use the code you find with great care; where attempts at browser detection
are made (look for navigator.userAgent), implement feature detection instead:

http://www.jibbering.com/faq/faq_not...er_detect.html
PointedEars
Nov 16 '07 #4

P: n/a
On Nov 16, 5:53 pm, Randy Webb <HikksNotAtH...@aol.comwrote:
Gordon said the following on 11/16/2007 12:12 PM:
Just a quickie. Is there a way to cause a browser to open it's
find... dialogue in response to an event, say a click on a button?

Not that I have ever been able to find in IE. If you are going to add a
button to the page, why not just put a note on the page telling how to
invoke the find dialog box? F3 key does the same thing as Ctrl-F does.
Because the boss wants a button to click that will open find. I'm
just the code monkey
Nov 18 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.