Click to See Complete Forum and Search --> : type and search text script


Code One
10-25-2003, 09:34 PM
Hey,
was looking for an easy solution for a script that will work as follows:
The user types a word to be searched for in a text input box. On the same page. Then when the user selects the search button(on the same page), the text which is either typed or pasted in the textarea, will be searched threw for that word typed in the input box, and if there is a match it will be highlighted., If no match it will display an alert box saying not found. Im sure Jscript can do this but, I am kinda unsure on how to set it up, I think it would be like a music keyboard type script that keeps in memory the key strokes and then is sent to find the exact match of the typed string.

Any help?

Code One

Shampie
10-25-2003, 10:08 PM
I am not sure if I can help 100% but I might be able to give you a start: check this site (http://www.trans4mind.com/personal_development/JavaScript/searchEngine.htm) for seaching with javascript.

and check this site (http://www.nsftools.com/misc/SearchAndHighlight.htm) for highlighting.

g'luck!

Code One
10-25-2003, 10:25 PM
this gives me some ideas but still it contains to div boxs or arrays, Im looking for a way to search and highlight manually typed text in a textarea,

thanks for the help though, it's greatly appreciated!

Code One