Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9029021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:08:54+00:00 2026-06-16T07:08:54+00:00

I have this code which permits me to reload the content of a page

  • 0

I have this code which permits me to reload the content of a page every few seconds.

function()
{
$('#lista').show().load('listaupdate.php').fadeIn("slow");}, 3000);

Now, the issue is, i have a search form there, but, how should i prevent refreshing when searching?

Or it can refresh ok, but after the search has been done, and after the results were given.
It’s the same issue with pagination, if i go to page 2, then it refreshes and takes me to page 1.

How can i solve this?
Thanks

search form:

<form action="listasearch.php" method="post">
<select name="kategoria">
  <option value="dyqani_pergjegjes">Dyqani Përgjegjës</option>    
</select> 
<input type="text" name="search">
 <input type="submit">
</form>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T07:08:55+00:00Added an answer on June 16, 2026 at 7:08 am

    The way I see this you have two options:

    1. Option 1 : Make the listaupdate.php return just the data and make AJAX call to it, rather than load and the build the markup in the complete handler (the idea is there it no point to reload the whole page, including the search form – just the data that needs updating). See http://api.jquery.com/jQuery.get/

    2. Option 2 – cancel updates when search field is being used by the user ( frankly not the better solution, but still). Do something like :

      var interval = setInterval(function(){
      $('#lista').show().load('listaupdate.php').fadeIn("slow");}, 3000);
      

    listen for some search-related event (make one of your own if focus deosn’t fit the case):

    $('input[name="search"]').on("focus", function(event){
         interval = clearInterval(interval);
    });
    
    // restart it when search is done
    $("form").submit( function(event){
             interval = setInterval(function(){
            $('#lista').show().load('listaupdate.php').fadeIn("slow");}, 3000);
      });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code which permits me to pass a variable to another page,
i have this quick issue please. I have this code here which permits me
I have this code which is called at an onChange event of an function
i have this code here which permits me to retrieve some dates. I have
i have this code which permits me to do a request in order to
I have this code which permits me to insert some dates i've selected in
I have this piece of code which permits me to print multiple dates, so
i have this piece of code which permits me to insert a title on
I have this code here please, which permits me to import data from a
I have this code which permits me to get some ids $sql_id_att=SELECT DISTINCT att_id

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.