简体   繁体   中英

How to remove html from search autocomplete input after click on search results?

I am using auto complete wordpress plugin and facing issue after clicking on searching results. After clicking on results, HTML is also inserted to input text field.

How I can filter html content from this input text field?

Here is the URL of the website, if anyone needs to check problem.

URL - http://web1.kindlebit.com/DEVELOPMENT/levi_dev/company/apple-inc/?part=key_statistics

Thanks,

I have check your website and review it. There is typo mistake in you ul li a span tag in search result;

Your span result generating like :

<sp<span class="sa-found-text 111">an cl<span class="sa-found-text 111">a</span>ss="symbol"&gt;WYNMY</sp<span>

that cause the issue

I have found an answer to my question.

I removed the typo mistake error by commenting code at search-autocomplete.min.js file as below :--

b.html(b.text().replace(new RegExp("(" + d + ")", "gi"), '$1'))

to

b.html(b.text());

and did some changes to success function to pass my desired value to input search box at

return{label:a.title,value:a.title,url:a.url}

to

return { label: a.title, value: a.id, url: a.url }

Where id is the custom key parameter passed to array containing the values.

Thanks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM