I know generally how to approach this, but my jQuery skills aren t quite up to par. Any help would be much appreciated! Here s what I m trying to do:
1) I have an existing textarea where user can enter text
2) I have an existing database table with string pairs (string1, string2)
3) I d like to be able to highlight all strings (maybe applying a <span class="highlight"></span>
with background color or italics in my css) as the user types them into the textarea that match any of the string1 results from the database (the strings could be one word or multiple word phrases, but would not be portions of a word). When the user hovers over the highlighted strings, the corresponding string2 appears in a basic qTip2.
4) If the user changed the text, the highlighting and qTip would go away if it no longer matched one of the string1 rows.
5) I envision creating a json array using PHP json_encode from the mysql_fetch_assoc recordset each time the page is called that would contain the string1 and string2 data since the string1 and string2 data is dynamic.