The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> PHP Example - AJAX Live Search help modifications, Looking for alternatives for search within search box
Dohm
post Mar 5 2021, 02:35 PM
Post #1





Group: Members
Posts: 6
Joined: 3-June 20
Member No.: 27,374



I’m using the example of from w3schools.com/php/php_ajax_livesearch.asp PHP Example - AJAX Live Search which searches in the xml file and works perfect.

Now what I would like to do is to have this search the "title" only and when it will do the filter, in the search box, and when the user selects this "Title", it will go on a specific page and not create a new page.. _self
What it is doing right now is when on click text from the search box, it creates a new page.

How would I go about to do the following...

Example1 insert text in search box: "test1" on click go to the designated _self page of <a href="subpages/code/test1.html"</a>
Example2 insert text in search box: "test2" on click go to the designated _self page of <a href="subpages/code/test2.html"</a>

So that if I have more test to create in the "links.xml" file, I would just need to upload it.

What i'm trying to do is to have a main search on my index.php and to not have to show every test text on the page but to search within the links.xml file (php/links.xml) and show the results in the search box, once the search is complete with the results, the user will be taken to this specific page. (_self not _blank or new)

I am working with a basic search/filter using
CODE
<ul id="myUL">
. Which is a cluster... Pretty new to this as I am learning as I go.

CODE

<input type="text" id="myInput" onkeyup="myFunction()" placeholder="Search for title..">

<ul id="myUL">
<li class="invalid nav-item"><a href="subpages/code/test1.html">test1</a></li>                        
<li class="invalid nav-item"><a href="subpages/code/test2.html">test2</a></li>
</ul>

I have around 1000 test page


So from:
CODE

<link><title>test1</title><url>https://www.w3schools.com/tags/tag_a.asp</url>
<link><title>test2</title><url>https://www.w3schools.com/tags/tag_a.asp</url>


To
CODE

<link><title>test1</title><url><a href="subpages/code/test1.html"</a></url>
<link><title>test2</title><url><a href="subpages/code/test2.html"</a></url>

Is this possible...

Or reading material so I can see what I need to do...

Thank you in advance.

This post has been edited by Dohm: Mar 5 2021, 02:40 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 19th March 2024 - 02:45 AM