Web Analytics Made Easy -
StatCounter Search data in Table - CodingForum

Announcement

Collapse
No announcement yet.

Search data in Table

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Search data in Table

    Hi,

    I have a window with no menu bar which lists data in a table with 2 columns.

    I would like to provide the user with an input box. When the user enters some text I would like to search the table for that text. If text exists, then move the focus, scroll to, to that text.

    Can this be done in javascript? Does someone have similar code they may want to share.

    Thanks,
    V

  • #2
    http://www.dynamicdrive.com/dynamicindex11/findpage.htm

    That works in NS4 and IE4+.

    I have my own script that works in NS6+ to an extent (finds the text, gets the offsets, etc), but utilizes Range.prototype.surroundContents inside a Text node, which currently doesn't work (well-known bug).
    jasonkarldavis.com

    Comment


    • #3
      I am trying to modify this script Find In Page Script All (url in the previous reply) , so the search string value will be passed from a link. something like this

      onClick="return findInPage(this.linkname.value);">linkname</a>

      Comment


      • #4
        Check my page on dynamic table construction. It shows how to access data in individual table cells in cross-browser compatible manner (DOM).

        http://www.vladdy.net/WebDesign/DOM_Tables.html
        Vladdy | KL
        "Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

        Comment


        • #5
          I've sorted out. It should be just
          onClick="return findInPage(linkname);">linkname</a>

          Comment

          Working...
          X