Question
Help with UDF
Howdy Folks,
I have a search page that returns a list of matches based on the user input. I thought it would be slick to show the user's search parameter in RED, inline in the returned results. I got this to work, but had issues with capitalization (inside the string, as opposed to only when the string began with the searched term. Also the code to do this was silly long and confusing. I wanted to create a UDF that would do the job without the massive switching in my page to page code. So far I am converting the returned results as such;
(see below)
And since there are several potential fields searched on (and returned) I have to adjust each seperately.
I would love to just have #red(str)# do the job in the back ground, but when I tried to create a UDF I just got the value reoutput with not style adjustment. Also I'm not sure how i could incorporate a "placement" checker to UCASE only the first letter when the search string IS the beginning of the result.
Thanks for any insight!
I have a search page that returns a list of matches based on the user input. I thought it would be slick to show the user's search parameter in RED, inline in the returned results. I got this to work, but had issues with capitalization (inside the string, as opposed to only when the string began with the searched term. Also the code to do this was silly long and confusing. I wanted to create a UDF that would do the job without the massive switching in my page to page code. So far I am converting the returned results as such;
(see below)
And since there are several potential fields searched on (and returned) I have to adjust each seperately.
I would love to just have #red(str)# do the job in the back ground, but when I tried to create a UDF I just got the value reoutput with not style adjustment. Also I'm not sure how i could incorporate a "placement" checker to UCASE only the first letter when the search string IS the beginning of the result.
Thanks for any insight!