Loading ...
Sorry, an error occurred while loading the content.

Iterating through a resultset

Expand Messages
  • flufflemeister
    I m doing a real time search application when you keyUp, it changes the view of the table to what you type... if you type ap , it ll search through last names
    Message 1 of 1 , Sep 29, 2006
    • 0 Attachment
      I'm doing a real time search application when you keyUp, it changes
      the view of the table to what you type... if you type "ap", it'll
      search through last names and first names if they have "ap" in it.

      At the moment, it's rendering only the first result that it finds in
      the XML document.

      this is the code:

      function successHandler(o){

      var root = o.responseXML.documentElement;

      var nodes = root.getElementsByTagName('StaffMember');



      for(i = 0; i < nodes.length; i++) {

      var node = nodes[i];

      var oFirstName =
      node.getElementsByTagName('staffFirstName')[0].firstChild.nodeValue;

      var oLastName =
      node.getElementsByTagName('staffLastName')[0].firstChild.nodeValue;

      element.innerHTML = "<tr><td>" + oFirstName + "</td><td>" +
      oLastName + "</td><td>Chose</td></tr>";

      }



      }

      element is the table id
    Your message has been successfully submitted and would be delivered to recipients shortly.