So as you can see from the images below, I’m using the input to search for questions & answers that contain the word “Star” or “star”. The search is case insensitive which is great! The question is displayed in both scenarios.
However when I use the “find & replace” function to change the color of the text being searched to blue, the “find & replace” function is case sensitive.
Is there a simple solution to this? @emmanuel, would it make sense to add a “make case insensitive” checkbox when using the “find & replace” function?
INSTRUCTION: Search “lorem” and then click out of the input box to see the JavaScript result at the bottom of the page.
I’m almost there. As you can see, when the user searches, items are displayed that contain the input’s value. All the way at the bottom is the result of the JavaScript (I changed it around a little). 2 things would solve this problem.
Instead of the blue “test” (see result at the bottom), it would be the EXACT word from the database. If it’s lowercase in the database, it’ll be lowercase in the result. Same with capitalized. The problem I had before was that I was using the value of the Input which will either be lowercase OR capitalized already.
If the “result” didn’t need a workflow to be displayed. Meaning the text was automatically changed when the search is going on.
Great, I’ll make the adjustments and let you know how it goes. And this is somewhat of a test site I’m going to present to the company. Want to collab/partner with them.
For anyone else trying this, make sure you use your Debugger. If a search happens when the page is loaded, you will have a different “process” than if the user needs to type in the input box once the page is loaded to trigger the first search.
When the question I’m searching uses “”, an error occurs. My solution to this was to change the “” to ‘’. That worked fine but is there anyway you see a way to still have “”?
See example below
When using ‘’ in the question, everything is perfect!
When using “” in the question, there is an error, resulting in not displaying the question.
No biggie if you can’t solve it. I spent about 30 mins figuring out what the problem was in the first place haha.
Here’s another image of the JavaScript