SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Member
    Join Date
    Mar 2000
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Most search utilities I've used are great at finding PAGES containing the keywords or phrases you enter. The problem is once you go to this webpage, you still have to search/scroll for the keywords or phrases since they're not highlighted.

    What I want to know is there a way to do the following?

    1. Place a button on a webpage that says "Search This Page"
    2. When the button is selected, it opens the "Find" window on a browser
    (for MSIE, this is Ctrl+F). I don't know what it would be in other
    browsers.

    When you do a Ctrl+F and enter the keywords or phrases, it highlights the ones it finds. This is what I am trying to accomplish.

    I've seen people use a "Click here to bookmark this page" link. I don't
    know how they do it, but it accomplishes the same as a Ctrl+D (add to favorites). Could this type of HTML be modified to be a "Click here to search this page" that does the Ctrl+F?

  2. #2
    SitePoint Guru Vincent Puglia's Avatar
    Join Date
    Feb 2000
    Location
    where the World once stood
    Posts
    700
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,

    Try
    result = document.find(fieldname.value);
    But if you want it to find the next "find" you would need to loop until false.

    Vinny

    ------------------
    GrassBlade: cut&paste javascript

  3. #3
    SitePoint Member
    Join Date
    Sep 1999
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I would try the following script: http://dynamicdrive.com/dynamicindex11/findpage.htm It uses DHTML to allow the visitor to directly search for any keyword on the page.

  4. #4
    SitePoint Member
    Join Date
    Mar 2000
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Adashimar,

    Thank you! This is exactly what I was looking for. I sincerely appreciate your help.

  5. #5
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Pressing CTRL-F (not sure what the key-combo is on a Mac) works wonders to search in a particular page. It works in all the major browsers and pops up a dialog box that allows you to find and find next.

    Doesn't even rely on a script and will work if they have javascript turned off.

    ------------------
    Wayne Luke
    WR Moderator
    Internet Media Provider


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •