On Sep 9, 10:12 pm, Jack <[EMAIL PROTECTED]> wrote:
> Hi,
>     I'm using 1.8.4 latest scriptaculous library for autocomplete
> functionality. Everything works Perfect!
>
>      I would like to know if scriptaculous supports highligting the
> returned results. When I type say "a" in the textbox, then the
> scrollable options will appear with results which contains "a". What I
> need is that the returned results should display the searched
> chanracter (in this case "a") in bold throughout all the occurences
> within resultset.
>
>     I'll appreciate if any one can help me acheiving this
> functionality using scriptaculous.
>
I would do this in your server-side code. Something like: (untested
PHP!)

function matchPart($part)
{
   $matches = getMatches($part);
  $result = "<ul>n";
  foreach ($match in $matches) {
    $result .= "<li>".preg_replace("/$part/g", "<em>$part</em>",
$match)."."</li>\n";
  }
  // Return your $result however you're doing it ...
}

Ajax.Autocompleter IIRC concatenates all the text nodes from the
selected <li>, so the <em> tags would just be omitted in the submitted
value.

Colin




> Thanks in Advance!
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to