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 5988809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:00:41+00:00 2026-05-22T23:00:41+00:00

I won’t to write some values into database with ajax on submit event, after

  • 0

I won’t to write some values into database with ajax on submit event, after that I want to query the database (with ajax) once again to check for some response that will be written after the first ajax action. Last, if the response values are “ok” then I want to refresh the page, else I will make the query 2 secs latter till the response gets ok!

//Write into database form values on submit event
$('form').submit(function(){
    $.post("submitForm.php", { "array": submitedArray});

//HOW to verify if submited values where well written into databse? 
   return false;
});

//ONLY after submit I want to query the database and based on the response values I will refresh the page every two seconds (if response values not good) or refresh only once (if values checked are good)

var refresh = setInterval(function(){
      $.getJSON('someOtherScript.php', function(data){
         $.each(data, function(index, value){
           //Check values 
     });                    
      });
   }, 2000);
  • 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-05-22T23:00:42+00:00Added an answer on May 22, 2026 at 11:00 pm

    If I have this correctly, you are using ajax to submit the form and want to do the check on callback.

    $.ajax({
      url: '/path/to/file',
      type: 'POST',
      dataType: 'xml/html/script/json/jsonp',
      data: {param1: 'value1'},
      complete: function(xhr, textStatus) {
        //called when complete
      },
      success: function(data, textStatus, xhr) {
        //called when successful
        // This is where you will do your get request to find the result you are looking for.
      },
      error: function(xhr, textStatus, errorThrown) {
        //called when there is an error
      }
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
For reasons I won't go into, I wish to ban an entire company from
For reasons that we won't discuss, I have determined that MAMP is a pile
This just won't work. The problem is that I do not know enough to
I have the following code that won't compile and although there is a way
Why won't this xml schema validate ? Visual studio says that the simpleContent tag
I won the bid on a project and now the client (who is itself
I know this won't be a popular question, because a lot of web designers
Any ideas why this won't validate here: http://validator.w3.org/#validate_by_input It seems the form input tags
My scheduled reports in SQL server won't run. I checked the logs and found

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.