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

  • Home
  • SEARCH
  • 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 968913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T02:33:31+00:00 2026-05-16T02:33:31+00:00

i have one submit form. i want if someone submit same data can show

  • 0

i have one submit form.
i want if someone submit same data can show jquery dialog “This data already exists! Are you sure to input?”
Then select OK or CANCEL.
can you tell me the step that must i do?thanks.

  • 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-16T02:33:31+00:00Added an answer on May 16, 2026 at 2:33 am

    Send an ajax request with data to server-side, and if data exist return some kind of errorcode. Then in ajax handler check for error, if it is present show message “Data already exist”, if not show message “Data was added”. Server-side should check for duplicates and insert new data as well.

    If user select “ok” in “Data exists” dialog, send another request with parameter to suppress duplicate error.

    Client:

    $.post("server.php", { "data": somedata }, function(result) {
     if (result.error && result.error == 1)
      if (confirm("Duplicate data, continue?"))
        $.post("server.php, { "data": somedata, "suppress": 1 }, function(result) {
          alert("Data was added");
        });
     else
      alert("Data was added");
    }, "json"); // we accept result in json format, jQuery will process it into JS object
    

    Server:

    if (isset($_POST['data']) && $_POST['data'] != "") {
      if ( check_duplicate($_POST['data']) // don't forget to implement this
           && $_POST['suppress'] != 1 )
        return '{ "error": 1 }';
      else {
        insert_data($_POST['data']);
        return '{ ok }'; // you can return empty string as well
      }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a form with this validation jquery $("#aioForm").on('submit',function(e){ var errorCount = 0; $('span.errorMessage').text('');
so here's the problem I have one form, it outputs search results after submit,
I am trying to have two submit buttons in my form - one accepts
I have one image submit button like this <input id=enter name=enter type=image value=Login src=images/btn_login.jpg/>
i have a page that contains several submit buttons however i only want one
Ok, this one is weird, i have this code: $('#nps').submit(function(e) { e.preventDefault(); var images
I am using jquery validation plugin to validate my form. I have one field
I have a jquery Ajax call function that I use to submit form to
I have a form which has one field username . If some one submit
I want to send data from one page to the other via a form

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.